Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to create a respawn GUI code?

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?

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)

1 comment

0

Scripting block please.

This discussion is preserved as it was. New answers, comments, and votes are closed.