Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i make this loop script work?

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

1 comment

0

Connecting to a changed event would work better than constantly checking.

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.