script.Parent.MouseButton1Down:connect(function(Click)
local player = game.Players.LocalPlayer
player:LoadCharacter()
end)
COMMUNITY QUESTION
This works in Studio, but not ingame?
4 answers
The LocalPlayer property can only be used in LocalScripts.
Scripts that access 'LocalPlayer' must be used in LocalScripts within a Local directory, such as the PlayerGui.
game.Players.PlayerAdded:connect(function(nP)
script.Parent.MouseButton1Down:connect(function(Click)
local player = nP
player:LoadCharacter()
end)
end)
The Term ' LocalPlayer ' can only be used in a local script
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I used a LocalScript.
Okay, so loadcharacter can only be used in regular scripts, so you will have to use a regular script and access the player a different way.