Im trying to make this script fun forever. so far this is what i tried and i doesn't work
while true do
wait(0.1) script.Parent.Transparency = 0.9 wait(0.1) script.Parent.Transparency = 0.8 wait(0.1) script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0.6 wait(0.1) script.Parent.Transparency = 0.5 wait(0.1) script.Parent.Transparency = 0.4 wait(0.1) script.Parent.Transparency = 0.3 wait(0.1) script.Parent.Transparency = 0.2 wait(0.1) script.Parent.Transparency = 0.1 wait(0.1) script.Parent.Transparency = 1
until false
This should work, I hope.
01 | while true do |
02 | for i = 1 , 0 , -. 1 do |
03 | wait( 0.1 ) |
04 | script.Parent.Transparency = i --'i' is a changing number value |
05 | end |
06 |
07 | for i = 0 , . 1 , . 1 do |
08 | wait( 0.1 ) |
09 | script.Parent.Transparency = i |
10 | end |
11 | end |
You're trying to 'disappear' a block, right? The 'Until False' that you're using it's incorrect, it'll never go false. Try this instead:
1 | while true do |
2 | for i = 1 , 10 do |
3 | wait( 0.1 ) |
4 | script.Parent.Transparency = script.Parent.Transparency - 0.1 |
5 | end |
6 | end |
...It should work. ;)
If you want an eisier to understand kinda one then try this
01 | while true do |
02 | if <var> = = false then |
03 | wait( 0.1 ) |
04 | script.Parent.Transparency = 0.9 wait( 0.1 ) script.Parent.Transparency = 0.8 |
05 | wait( 0.1 ) |
06 | script.Parent.Transparency = 0.7 wait( 0.1 ) script.Parent.Transparency = 0.6 |
07 | wait( 0.1 ) |
08 | script.Parent.Transparency = 0.7 wait( 0.1 ) script.Parent.Transparency = 0.4 |
09 | wait( 0.1 ) |
10 | script.Parent.Transparency = 0.7 wait( 0.1 ) script.Parent.Transparency = 0.2 |
11 | wait( 0.1 ) |
12 | script.Parent.Transparency = 0.7 wait( 0.1 ) script.Parent.Transparency = 0 |
13 | else |
14 | return end |
15 | end |
16 | end |
idk if this is what u want but ok...
If you want the loop to stop when the part is completely invisible then you can make a simple change to SuperAndresZ_YT's loop. Just remove the while loop and the for loop will do it's job and stop after 10 loops.
For example:
1 | for i = 1 , 10 do |
2 | wait( 0.1 ) |
3 | script.Parent.Transparency = script.Parent.Transparency - 0.1 |
4 | end |
5 | end |
6 |
7 | wait( 1 ) |
8 | script.Parent.Transparency = 1 |
Another way to do the same thing:
1 | while script.Parent.Transparency > 1 do |
2 | wait() |
3 | script.Parent.Transparency = script.Parent.Transparency - 0.1 |
4 | end |
5 |
6 | wait( 1 ) |
7 | script.Parent.Transparency = 1 |