Hello I have been having a hard time trying to script my players to have to wait longer to respawn.
So here is a basic answer for you:
01 | local RespawnTime = 5 ; -- in seconds |
02 |
03 | game.Players.CharacterAutoLoads = false -- makes it so the character wont load till called using :LoadCharacter() event |
04 |
05 | local function PlayerAdded(Player) |
06 |
07 | Player.CharacterAdded:Connect( function (Character) -- CharacterAdded event |
08 |
09 | local Humanoid = Character:WaitForChild( "Humanoid" ) -- Wanna wait for the humanoid so we don't get errors! |
10 |
11 | Humanoid.Died:Connect( function () -- activates when the character dies x.x |
12 |
13 | wait(RespawnTime) -- respawn timer!!! |
14 |
15 | Player:LoadCharacter() -- after the timer, Load the character! |