Any help?
script.Parent.BackgroundTansparency = 1 wait(0.1) script.Parent.BackgroundTansparency = 0.9 wait(0.1) script.Parent.BackgroundTansparency = 0.8 wait(0.1) script.Parent.BackgroundTansparency = 0.7 wait(0.1) script.Parent.BackgroundTansparency = 0.6 wait(0.1) script.Parent.BackgroundTansparency = 0.5 wait(0.1) script.Parent.BackgroundTansparency = 0.4 wait(0.1) script.Parent.BackgroundTansparency = 0.3 wait(0.1) script.Parent.BackgroundTansparency = 0.2 wait(0.1) script.Parent.BackgroundTansparency = 0.1 wait(0.1) script.Parent.BackgroundTansparency = 0 wait(0.1)
There's a typo and please Use a for loop
for i=1,0,-0.1 do script.Parent.BackgroundTransparency = i end
Its simple, you can use a for loop
(generic loop) and a wait(0.1)
Wait is for loop?
The for loop is a way of running a command or set of commands a set number of times. The basic syntax is as following:
How to use for loop?
for iterator_variable = start value , end value , increment do
(this is in wiki)
examples:
-- 1 for i = 1, 5 do print("Hello Mom!") -- Print Hello Mom 5 times end -- 2 for i = 10, 1, -1 do print(i) -- print number with start value 10 to 1: removing 1 end -- 3 for i = 1, 10, 0.5 do print(i) -- print number with start value 1 to 10: removing 0.5 end
Here is fixed script:
for i=1,0,-0.1 do -- value with 1 to 0: removing 0.1 until value not 0 script.Parent.BackgroundTransparency = i -- set the transparency wait(0.1) -- Simple wait to have a delay when changing the transparency end
Wiki pages:
Hope it helped :D