So I'm having a problem with my script. It keeps skipping lines. The code is done below and it tells you where it keeps skipping. I'm sure it's some problem with where my "ends" are but I'm not sure. Any help?
local replicatedstorage = game:GetService("ReplicatedStorage")
local status = replicatedstorage:WaitForChild("StatusValue")
wait(3)
while true do
Song = Instance.new("Sound")
Song.Parent = workspace
Song.Volume = 1
Song.Looped = false
Assets = {274504661,346191865,263966756,220964582,362105653}
for _, asset in ipairs(Assets) do
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. asset)
end
Song.SoundId = "http://www.roblox.com/asset/?id=" ..Assets[math.random(1,#Assets)]
Song:Play()
-- Intermission
for i = 30,0,-1 do
status.Value = "INTERMISSION: "..i
wait(1)
end
-- Round
status.Value = "CHOOSING THE MAP. [LAG]"
wait(0.5)
status.Value = "CHOOSING THE MAP.. [LAG]"
wait(0.5)
status.Value = "CHOOSING THE MAP... [LAG]"
wait(0.5)
local num = math.random(1,2)
if num == 1 then
game.Lighting.SampleMap:Clone().Parent = game.Workspace
status.Value = "SAMPLE MAP! MADE BY: ICYWYVERN!"
wait(2)
target = CFrame.new(13.153, -126.708, 357.876)
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 * 0, 0)
end
end
if num == 2 then
game.Lighting.SampleMap:Clone().Parent = game.Workspace
status.Value = "SAMPLE MAP! MADE BY: ICYWYVERN!"
wait(2)
target = CFrame.new(13.153, -126.708, 357.876)
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 * 0, 0)
end
end
-- It completely skips everything after this line and starts again
wait(1)
Song:stop()
wait(2)
game.Workspace.TornadoSirens:play()
wait(0.1)
for i = 40,0,-1 do
status.Value = "TIME TO PREPARE: "..i
wait(1)
game.Workspace.Round:Play()
game.Lighting.Clouds:Clone().Parent = game.Workspace
wait(2)
game.Lighting.Tornado:Clone().Parent = game.Workspace
for i = 120,0,-1 do
status.Value = "TIME LEFT: "..i
wait(1)
game.Workspace.Round:Play()
status.Value = "GAME OVER"
game.Workspace.Round:Stop()
wait(1)
end
end
end
end
end
