Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

Why Script Stops After Some Game Rounds?

Asked by 6 days ago

It Works, It Loads like 7 maps, then The Time (S.Value) Sets to 0, and does nothing, What Am I Doing wrong?

        local s = script.Stat
-------------------------------------------------
local f = workspace.FINISH.Fini


--------------inermission-------------------
t = 0
while true do
    t= 8
    repeat
        t= t-1
        s.Value = "Next Map Loading in "..t
        wait(1)
    until t == 0

game.Workspace.Lobby.DROPDOWN.Gate.CFrame = CFrame.new(95, 192.5, -1304)
game.Workspace.Lobby.DROPDOWN.Gate.Transparency = 1

-----------------------------
game.Workspace.Gravity = 20
------------- Maps------------------------
        local Maps = {'Yellow','Purple','Sphere','Cylinder','Spike','Rainbow','Lava','Ice','Eagle','YouTube','Sand','Umm','Carpet'}
local randomMap = math.random(1, #Maps)
for i,v in pairs(Maps) do
    if randomMap == i then
        local storage = game:GetService("ReplicatedStorage")
        local map = storage.Maps:WaitForChild(v):clone()
        map.Parent = workspace.MapPlaying

        if randomMap == 1 then
    f.Value = "Yellow Has Been Chosed"

elseif randomMap == 2 then
    f.Value = "Purple has Been Chosed"
elseif randomMap == 3 then
    f.Value = "Sphere Has Been Chosed"
        elseif randomMap == 4 then
            f.Value = "Cylinder Has Been Chosed"
        elseif randomMap == 5 then
            f.Value = "Spike Has Been Chosed"
            elseif randomMap == 6 then
            f.Value = "Rainbow Has Been Chosed"
elseif randomMap == 7 then
            f.Value = "Lava Has Been Chosed"
elseif randomMap == 8 then
            f.Value = "Ice Has Been Chosed"
elseif randomMap == 9 then
            f.Value = "Eagle Has Been Chosed"
elseif randomMap == 10 then
            f.Value = "YouTube Has Been Chosed"
elseif randomMap == 11 then
            f.Value = "Sand Has Been Chosed"
            elseif randomMap == 12 then
            f.Value = "Umm Has Been Chosed"
elseif randomMap == 13 then
            f.Value = "Carpet Has Been Chosed"
end
end
end
wait(1)
f.Value = ""


        t = 17
        repeat
            t = t-1
            s.Value = t.." Seconds Left To Complete DropDown"
        wait(1)
        until t == 0
        ------------- gate

target = CFrame.new(40, 162.06, 70)
for i, player in ipairs(game.Players:GetChildren()) do
    player.Character.UpperTorso.CFrame = target
    --add an offset of 5 for each character
end


                game.Workspace.Lobby.DROPDOWN.Gate.CFrame = CFrame.new(41, 159.5, 21.5)
game.Workspace.Lobby.DROPDOWN.Gate.Transparency = 0
        ------------
        workspace.MapPlaying:ClearAllChildren()
----------------------------
game.Workspace.Gravity = 180
----------------------------
end

s.Value = "Game Ended"
wait(5)
0
please concatenate from the maps table instead of 13 if statements :/ theking48989987 769 — 6d

1 answer

Log in to vote
-1
Answered by 6 days ago

I think I know what it is. You do not have a while loop to loop the whole thing, so it stops.

0
he's asking why it stops, not how to make it stop theking48989987 769 — 6d
0
NUUUUU I was at 100 rep DominusInfinitus 135 — 6d
0
So @DominusInfinitus, You Only Care For Reps? I'm Asking Why The Script Stops. ItzJester2 12 — 5d
0
uh ok sorry for this answer DominusInfinitus 135 — 5d
Ad

Answer this question