Here is some timer script thing I found on the internet, but it has the word "teleport" in it so i'm confused:
local seconds = game.Workspace.Time local ingame = game.Workspace.InGame.Value local Game = game.Workspace.Game.Position
while true do
wait(1) seconds.Value = seconds.Value - 1
if seconds.Value == 0 and ingame == 0 then
ingame = 1 seconds.Value = 20
local teleport = game.Players:GetChildren() for i = 1, #teleport do teleport[i].Character:MoveTo(Vector3.new(Game.X, Game.Y, Game.Z))
end end
if seconds.Value == 0 and ingame == 1 then
ingame = 0 seconds.Value = 15
local teleport = game.Players:GetChildren() for i = 1, #teleport do teleport[i]:LoadCharacter()
end end
end
LocalScript in TextLabel:
while true do script.Parent.Text = game.Workspace.Time.Value wait(0.01) end
What the script you found is doing is teleporting all the players in the game to a certain position in game.
For a death timer, you would need to tell the script to wait 10 seconds and kill the players that you want to kill.
If you wanted to kill all the players, it would look like the following below. If there's anything you don't understand, write a comment below and I can try to explain a bit more.
timeLeft = 10 -- how many seconds to wait before the players get killed -- a function that kills all the players in the game. function killPlayers() local players = game.Players:GetChildren() --loop through all the players killing each one of them for i, v in ipairs(players) do local character = game.Players:FindFirstChild(v.Name) if(character)then character.Humanoid.Health = 0 -- kills character end end end -- when this function is called, the game will start counting down the death timer function countdown() --lthis is a loop that that counts down every second until i is 0 --take note that the variable i is changing not the actual timeLeft variable for i = timeLeft, 0, -1 do wait(1) killPlayers() end end --call the countdown function whenever you want the game to countdown. right now i'm calling it when the game starts. countdown()