So I'm making a game and I want to have a GUI and when you click it your character respawns but I don't know how to code that, any help?
✓ ANSWER ACCEPTED
How to create a respawn GUI code?
2 answers
✓ Accepted answer
Actually, a nicer method would be to use player:LoadCharacter(), this will reload their character immediately. To use this script create a Remote Event object and place it in workspace. Call it "reload".
In a Local Script:
script.Parent.MouseButton1Down:connect(function()
workspace.reload:FireServer()
end)
In a Server Script:
workspace.reload.OnServerEvent:connect(function(player)
player:LoadCharacter()
end
function click() game.Players.LocalPlayer.Character.Humanoid.Health = 0 end
script.Parent.MouseButton1Down:connect(click)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Scripting block please.