I want the brick "Eyelid1" to alternate between transparency 1 and 0 every (0.5) seconds endlessly in a loop. Where am I going wrong? Also note, I put "Eyelid1" in a folder named "Eyelid".
while true do game.Workspace.Eyelid.Eyelid1.Transparency = 1 wait(0.5) game.Workspace.Eyelid.Eyelid1.Transparency = 0 end
local part = script.Parent while true do part.Transparency = 1 wait(0.5) part.Transparency = 0 wait(0.5) -- this makes it so it can start over end
local part=--your part while true do if part.Transparency==0 then part.Transparency=1 else part.Transparency=0 end wait(0.5) end
If you want the eyes to close more smoothly, then you can use a for i loop.
while true do for i = 1, 20 do game.Workspace.Eyelid.Eyelid1.Transparency - 0.05 wait(0.02) end for i = 1, 20 do game.Workspace.Eyelid.Eyelid1.Transparency + 0.05 wait(0.02) end end