script.Parent.MouseButton1Click(function(player) player:LoadCharacter() end)
The even MouseButton1Click
does NOT give you the player who actually touched the button. Oh, and you also forgot to add :connect
.
If the script is a localscript inside of a gui, replace that with this:
local Player=game:GetService("Players").LocalPlayer script.Parent.MouseButton1Click:connect(function() Player:LoadCharacter() end)
If that does not work, put true
inside of the parentheses of :LoadCharacter