How do I get the name of the player that pressed a GUI button. Doesn't seem to hard I just need help. I want the player's name stored in a variable.
ScreenGui > TextLabel and a Text Button LocalScript Inside TextButton
1 | TextLabel = script.Parent.Parent.TextLabel |
2 | script.Parent.MouseButton 1 Click:connect( function () |
3 | -- script here example |
4 | p = game.Players.LocalPlayer |
5 | p.Character.Torso.Anchored = false |
6 | TextLabel.Text = p.Name |
7 |
8 | end ) |