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

Why aren't these scripts going at the same rate?

Asked by 5 years ago

Hello! I have been putting some finishing touches on my latest model and have some flashing parts on it. Basicly there are four parts; Two have this script in it:

while true do wait()
wait(0.1)   
    script.Parent.Transparency = 1
    wait(0.1)
    script.Parent.Transparency = 0

end

And the other two have this script in it:

while true do wait()
wait(0.1)   
    script.Parent.Transparency = 0
    wait(0.1)
    script.Parent.Transparency = 1

end

Basicly the parts seem to alternate in an infinite loop. But the problem is they eventualy get unsyncronized and they flash at random times and together it looks really messy. IS ther anyway to stop this?

2
You can synchronize their threads by compacting all four scripts into one. This will result in a more efficient execution, with no visible margin of error. Redbullusa 1580 — 5y
0
^ Goulstem 8126 — 5y

Answer this question