i'm making a teleport room for my roblox game, i used a MouseButton1Click event that will add the player to the table, but something went wrong, i have just clicked the Gui once but the event fire a lot of times and insert a lot of thing to the table (my roblox username), how can i fix it ?
this is what i can do, tell me if there is something wrong.
01 | gui.MouseButton 1 Click:Connect( function (plr) |
02 | if not plr:FindFirstChild( "HasJoined" ) then |
03 | local hasjoined = Instance.new( "BoolValue" , plr) |
04 | hasjoined.Name = "hasjoined" |
05 |
06 | if not plr:WaitForChild( "HasJoined" ).Value = = true then |
07 | hasjoined.Value = true |
08 | //put the rest of your script here |
09 | end |
10 | end |
11 | end ) |