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

How do i make this loop script work?

Asked by 10 years ago

I don't know but i want this script to make a Decal Visible when a Part's BrickColor is Bright yellow but it doesn't work!

how does this work?

this is what i got done:

while true do
wait(0.5)
if script.Parent.Parent.Flag.BrickColor == "Bright yellow" then
    script.Parent.Parent.Flag.Decal.Transparency = 0

else

    script.Parent.Parent.Flag.Decal.Transparency = 1
wait(0.5)
end
end

nothing of a error appears in the Output

0
Connecting to a changed event would work better than constantly checking. GoldenPhysics 474 — 10y

1 answer

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

Try this small change:

while true do
wait(0.5)
if script.Parent.Parent.Flag.BrickColor == BrickColor.new("Bright yellow") then
    script.Parent.Parent.Flag.Decal.Transparency = 0

else

    script.Parent.Parent.Flag.Decal.Transparency = 1
wait(0.5)
end
end
Ad

Answer this question