while true do
local sped = script.val.Value
if sped > 0 then
sped = sped - 1
script.Parent.Humanoid.WalkSpeed = 25
wait(1)
script.Parent.Humanoid.WalkSpeed = 16
end
end
This is a script in StarterCharacterScripts that is supposed to make you run faster when you have more speed in the speed value. You are supposed to step on these purple circles that makes you run faster for 3 seconds, and it does that by setting the value inside the script to 3, and then the script makes you run for as long as the value is set (in seconds). It doesn't run though, and the error is Script timeout: exhausted allowed execution time. I don't know if its a problem with the script or what the error is. None of my other scripts do this, so it has nothing to do with the loop (i think). If you could help, I would appreciate that. Thanks.

2 comments
You can also do while wait() do at line 1
Is there a major difference between while wait() do & while true do? It seems like they both hold the same purpose.