I basically need help finding a way to script a GUI button so that when a player clicks the button, the script finds out who clicked it and then goes into game.Workspace.Playerwhoclicked.Intvalue . I made the following script but I am not convinced that it receives only that players info. Script:
function onClicked(Player) local c = game.Players:GetChildren() for i = 1, #c do local candy = c[i].Character:findFirstChild("Money") print(candy.Value) end end script.Parent.MouseButton1Click:connect(onClicked)
Use your argument.
function onClicked(plr) local candy = plr.Character:FindFirstChild("Money") print(candy.Value) end script.Parent.MouseButton1Click:connect(onClicked)