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

Change name for rp purposes but it says global player is a nil value. what did i do wrong?

Asked by 6 years ago
Edited 6 years ago
script.Parent.MouseButton1Click:connect(function()
    player.Character.Name = script.Parent.Parent.TextBox.Text
end)

it doesnt like player whatd do i put instead

1 answer

Log in to vote
0
Answered by 6 years ago

Well you never actually define player in this script. All you would need to do is put this in a local script if it isn’t already in one and make a variable of that for the player like this:

player = game.Players.LocalPlayer

Simple as that, hope I helped.

Ad

Answer this question