So I have tried for a while now to get the name of a player that presses a button to a textlabel but it won't work. I'm not entirely sure what I'm doing wrong.
script.Parent.MouseButton1Down:connect(function()
local TextLabel = script.Parent.Parent.TextLabel
TextLabel.Text = game.Players.LocalPlayer.Name
end)

4 comments
Is this a localscript?
Yes it is!
Theres nothing wrong with this script. Make sure that its actually being run, like a print at the beginning, and if not look around to see why its not
Also make sure your paths to the ui are correct