I'm trying to make a person blink And I tried to do it but it didn't work. (There faces dont use decals they use parts)
Blink = Game.Parent while true do wait 5 Blinking = math.random(1,5) if Blinking == 1 then Blink.Transparency = 1 end if Blinking == 2 then Blink.Transparency = 0 end if Blinking == 3 then Blink.Transparency = 1 end if Blinking == 4 then Blink.Transparency = 1 end if Blinking == 5 then Blink.Transparency = 0 end
What did i do wrong? I have no idea cause I'm new to scripting.
Also if you want to see the face of the person that I'm trying to make blink then check it out here. https://www.roblox.com/games/1366389432/Plastic-World-Testing
So there is two things we will have to change to make it work and one thing to change to make your code pretty.
The first is that you set Blink to the parent of the Game with Blink = Game.Parent
. I'm going to guess that if this is a part then it is not the parent of the game, but the parent of the script. We will want to change our script to read.
Blink = script.Parent
Now if the script is placed so that it's parent is the block then it will start blinking in transparency.
The other thing is that we have to add one more end at the end so that we end both the if statement and the while loop. Here's your code with those changes applied.
Blink = script.Parent while true do wait(5) -- This is my cosmetic change that I mentioned! This is a comment. Blinking = math.random(1,5) if Blinking == 1 then Blink.Transparency = 1 end if Blinking == 2 then Blink.Transparency = 0 end if Blinking == 3 then Blink.Transparency = 1 end if Blinking == 4 then Blink.Transparency = 1 end if Blinking == 5 then Blink.Transparency = 0 end end -- Added an end here. This is also a comment.