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

How do I create a script that resets the character/player when he/she enters the game?

So I want to reset the player's character automatically as soon he/she enters the game. How can I do that? What should I put in the script that does that?

2 answers

✓ Accepted answer

Hmm, I'd probly do this (for a localscript);

wait(0) --Waits 0 seconds before script starts
repeat wait(0)until game.Players.LocalPlayer --Keeps waiting until LocalPlayer
if game.Players.LocalPlayer:FindFirstChild("RespawnedAlready")then --If script finds RespawnedAlready within LocalPlayer then
script:Destroy() --Destroys script
else --Else if didn't
Instance.new("BoolValue",game.Players.LocalPlayer).Name = "RespawnedAlready" --Makes the Value for RespawnedAlready
game.Players.LocalPlayer:LoadCharacter() --Respawns the LocalPlayer
end --The end for the 'if' statement

Hope this helped!

2 comments

1

Thanks so much for your help!

0

No problem bro, glad to help! ;D

Use as a script in workspace rather than a local script.

game.Players.PlayerAdded:connect(function(plr)
repeat wait() until plr.Character
plr.Character:BreakJoints()
end)

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