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:

01while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 0 do
02    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
03        if v:IsA("BasePart") then
04            v.Transparency = 1
05        end
06    end
07end
08 
09while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 1 do
10    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
11        if v:IsA("BasePart") then
12            v.Transparency = 0
13        end
14    end
15end

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()

01while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 0 do
02    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
03        if v:IsA("BasePart") then
04            v.Transparency = 1
05        end
06    end
07wait()
08end
09 
10while workspace["Water, Start, Timer, and Platforms"].Start.Transparency == 1 do
11    for _,v in pairs(workspace["Water, Start, Timer, and Platforms"].Platforms:GetChildren()) do
12        if v:IsA("BasePart") then
13            v.Transparency = 0
14        end
15    end
16wait()
17end
Ad
Log in to vote
0
Answered by
mqop3434 -64
4 years ago

Wait() = 0.03 seconds

Answer this question