generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: What is the click function for SurfaceGui buttons?

Previous Thread :: Next Thread 
CrimsonForce is online. CrimsonForce
Joined: 11 Sep 2010
Total Posts: 35714
31 Mar 2015 12:14 PM
script.Parent.MouseButton1Click:connect(function()
local marketId = 23032507
link:PromptProductPurchase(plr,marketId)
link.ProcessReceipt = function(receiptInfo)
if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then
if deb == 0 then
deb = 1
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value + 25
wait(1)
deb = 0
end
end
end
end)

This is in an ImageButton inside of a SurfaceGui and won't even show that it's being clicked. Should I use a ClickDetector instead, or..?
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
31 Mar 2015 12:15 PM
SurfaceGui's can not detect client events if it's on the server.
Report Abuse
baldo46 is not online. baldo46
Joined: 28 Jul 2008
Total Posts: 1254
31 Mar 2015 12:15 PM
Make sure the SurfaceGui is Enabled.
Report Abuse
CrimsonForce is online. CrimsonForce
Joined: 11 Sep 2010
Total Posts: 35714
31 Mar 2015 12:17 PM
The surface gui is enabled.
Report Abuse
CrimsonForce is online. CrimsonForce
Joined: 11 Sep 2010
Total Posts: 35714
31 Mar 2015 12:17 PM
morash, I've seen it work in Ripull's minigames
Report Abuse
iamsmartcookie is not online. iamsmartcookie
Joined: 18 Aug 2012
Total Posts: 2738
31 Mar 2015 12:28 PM
adornee to the brick
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
31 Mar 2015 12:50 PM
That's not in the workspace, it's in your PlayerGui.
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
31 Mar 2015 12:52 PM
Place the SurfaceGui in your PlayerGui.

With a LocalScript, do this:
YourSurfaceGUI.Adornee = YourPart
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image