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

TroubleShoot my Script?

Asked by 10 years ago

My script contiues to loop, and i do not want it to, i want it to end as soon as the script finishes, but it doesnt, i have tried numerous times to fix it, but it doesnt work, Can you help.

while true do
wait(2)
script.Game.Value = false
wait(5)
for k, p in pairs(game.Players:GetPlayers()) do
    Spawn(function()
        game.Lighting.GameThing:Clone().Parent = p.PlayerGui
        wait(20)
        p.PlayerGui.GameThing:Remove()
        wait()
        p.PlayerGui.Progress:Remove()
        p.PlayerGui.Spectate:Remove()
    end)
end
wait()
local Map = game.Lighting.Map:clone()
Map.Parent = game.Workspace 
Map:makeJoints()
Players = game.Players:GetChildren()
for i = 1, #Players do
    Players[i].Character:MoveTo(Vector3.new(-5.4, 4.39, -64.7))
    script.Game.Value = true
end 
end

1 answer

Log in to vote
1
Answered by 10 years ago

Uhm, remove the while loop?

script.Game.Value = false
wait(5)
for k, p in pairs(game.Players:GetPlayers()) do
    Spawn(function()
        game.Lighting.GameThing:Clone().Parent = p.PlayerGui
        wait(20)
        p.PlayerGui.GameThing:Remove()
        wait()
        p.PlayerGui.Progress:Remove()
        p.PlayerGui.Spectate:Remove()
    end)
end
wait()
local Map = game.Lighting.Map:clone()
Map.Parent = game.Workspace 
Map:makeJoints()
Players = game.Players:GetChildren()
for i = 1, #Players do
    Players[i].Character:MoveTo(Vector3.new(-5.4, 4.39, -64.7))
    script.Game.Value = true
end 

Ad

Answer this question