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

Is there a way to bypass the "Script timeout: exhausted allowed execution time" error?

Asked by
DemGame 271 Moderation Voter
4 years ago

Here is my code:

while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 0 do
    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
        if v:IsA("BasePart") then
            v.Transparency = 1
        end
    end
end

while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 1 do
    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
        if v:IsA("BasePart") then
            v.Transparency = 0
        end
    end
end

Any suggestions?

1
add a wait() to the while loops Leamir 3138 — 4y

2 answers

Log in to vote
1
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago

add a wait()

while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 0 do
    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
        if v:IsA("BasePart") then
            v.Transparency = 1
        end
    end
wait()
end

while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 1 do
    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
        if v:IsA("BasePart") then
            v.Transparency = 0
        end
    end
wait()
end
Ad
Log in to vote
0
Answered by
mqop3434 -64
4 years ago

Wait() = 0.03 seconds

Answer this question