Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to create a respawn GUI code?

Asked by 7 years ago

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

Log in to vote
1
Answered by
Notwal 2
7 years ago

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
Ad
Log in to vote
-1
Answered by 7 years ago

function click() game.Players.LocalPlayer.Character.Humanoid.Health = 0 end

script.Parent.MouseButton1Down:connect(click)

0
Scripting block please. Async_io 908 — 7y

Answer this question