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 5 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 — 5y

1 answer

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

So here is a basic answer for you:


local RespawnTime = 5; -- in seconds game.Players.CharacterAutoLoads = false -- makes it so the character wont load till called using :LoadCharacter() event local function PlayerAdded(Player) Player.CharacterAdded:Connect(function(Character) -- CharacterAdded event local Humanoid = Character:WaitForChild("Humanoid") -- Wanna wait for the humanoid so we don't get errors! Humanoid.Died:Connect(function() -- activates when the character dies x.x wait(RespawnTime) -- respawn timer!!! Player:LoadCharacter() -- after the timer, Load the character! end end) print(Player.Name, "has loaded") end game.Players.PlayerAdded:Connect(PlayerAdded) -- Connect PlayerAdded function
Ad

Answer this question