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

t I forgot how to loop I want to loop an intermission script but I forgot how?

Asked by 4 years ago

script that I want to loop here

local tvalue = script.Parent.StatusTag 

function beginGame()
    for i = 30, 0, -1 do 
        wait(1)
        tvalue.Text = "Intermission: " .. i .. "" 
        if i == 0 then
            tvalue.Text = "Hide!" 
            target = CFrame.new(-298.717, 374.494, 95.422) 
for i, player in ipairs(game.Players:GetChildren()) do 
   if player.Character and player.Character:FindFirstChild("Torso") then 
      player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0) 
   endtar
end
        end --Ends
    end
end

if game.Players.NumPlayers > 0 then 
    beginGame()
end
local tvalue = script.Parent.StatusTag 

function beginGame()
    for i = 300, 0, -1 do 
        wait(1)
        tvalue.Text = "Game: " .. i .. "" 
        if i == 0 then
            tvalue.Text = "Game Over!" 
            target = CFrame.new(-177.9, 353.059, -542.5) 
            for i, player in ipairs(game.Players:GetChildren()) do 
                if player.Character and player.Character:FindFirstChild("Torso") then 
                    player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0) 
                end
            end
        end --Ends
    end
end

if game.Players.NumPlayers > 0 then 
    beginGame()
end
0
lol answered my own thing TEETHOF09 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

while true do wait () --code here end

Ad

Answer this question