I understand that if you click a brick with the function
script.Parent.ClickDetector:connect(function(p) player = p.Parent end)
But how would I get player in a textbutton on a surfacegui? I can't work it out. Thanks.
For a surface gui it would have to be a local script put in starterpack/startergui. So we will be able to use localplayer. Example:
local textbutton = workspace.Part.SurfaceGui.TextButton textbutton.MouseButton1Click:connect(function() print(game.Players.LocalPlayer) plr = game.Players.LocalPlayer end)
That should work, hope it helped!