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

How to change the time the playes respawn?

Asked by 6 years ago

Hello I have been having a hard time trying to script my players to have to wait longer to respawn.

3
Have your script disable CharacterAutoLoads, then use the :LoadCharacter() method to spawn the player. exxtremestuffs 380 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

So here is a basic answer for you:

01local RespawnTime = 5; -- in seconds
02 
03game.Players.CharacterAutoLoads = false -- makes it so the character wont load till called using :LoadCharacter() event
04 
05local 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!
View all 25 lines...
Ad

Answer this question