script.Parent.MouseButton1Click(function(player)
player:LoadCharacter()
end)
✓ ANSWER ACCEPTED
I want the person that clicks the GUI to respawn, but it doesn't work??
1 answer
✓ Accepted answer
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
This discussion is preserved as it was. New answers, comments, and votes are closed.
