Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Get name of player when pressing a button to a textlabel?

Asked by 5 years ago

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)
0
Is this a localscript? DanzLua 2879 — 5y
0
Yes it is! ArvidDC 0 — 5y
0
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 DanzLua 2879 — 5y
0
Also make sure your paths to the ui are correct DanzLua 2879 — 5y

Answer this question