Is it possible to check if a player has already clicked a button? Like if a player has already went through the Surface GUI and got something and then when they click it again they wouldn't be able to.
COMMUNITY QUESTION
How can I check if a player has already clicked a button before?
2 answers
You could insert a BoolValue into the player (or the SurfaceGui but I'm not sure if this is a good idea) to check if the button has been clicked before. http://wiki.roblox.com/index.php?title=API:Class/BoolValue
The best way to do this would be to place the surfacegui into StarterGui. That way, you can track which player clicked it. An example:
LocalScript inside surfacegui:
script.Parent.Adornee = workspace.GuiPartExample
Then, to check if the player has already clicked it, you can insert a value into the player! Example inside a localscript:
local plr = game.Players.LocalPlayer
script.Parent.Button.MouseButton1Down:connect(function()
if not plr:FindFirstChild('ClickedButton') then
-- do stuff
local value = Instance.new('BoolValue',plr)
value.Name = 'ClickedButton'
end)
2 comments
0
The LocalScript doesn't make anything visible that's the problem.
0
If you want, I could create an example place?
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
On a Surface GUI you carnt find the player, there are a lot of question on this forum relating to this. You might be able to do somthing localy with FE enabled http://wiki.roblox.com/index.php?title=Local_parts