I was trying to do a rebirth Gui, and want the players to respawn after they rebirth. How can I do that?
[It's a Local Script]
local stats = game.Players.LocalPlayer.leaderstats
script.Parent.MouseButton1Click:connect(function()
if stats.LifeFormFound.Value >= 10 then
game.Players.LocalPlayer.leaderstats.LifeFormFound.Value = 0
game.Players.LocalPlayer.leaderstats.Rebirth.Value = game.Players.LocalPlayer.leaderstats.Rebirth.Value +1
else
game.Players.LocalPlayer.leaderstats.LifeFormFound.Value = game.Players.LocalPlayer.leaderstats.LifeFormFound.Value
game.Players.LocalPlayer.PlayerGui.RebirthFail.Frame.Visible = true
wait(3)
game.Players.LocalPlayer.PlayerGui.RebirthFail.Frame.Visible = false
end
end)

8 comments
http://robloxdev.com/api-reference/function/Player/LoadCharacter
what I meant is that when I click the rebirth button, it will respawn the player, not when they died
^ Yeah, use the LoadCharacter() function on the player. It’ll respawn them.
How, where to place it? Write a answer
^ Probably after line 5 after the player receives his/her rebirth.
still does not work
LoadCharacter is server side only
while how can I do it tho? what should I put or do?