I'm trying to make a fountain, so I wanted to make the water coming out of it to be random transparency so it looks real. But it won't work.
1 | trans = { . 1 ,. 2 ,. 3 ,. 4 ,. 5 ,. 6 ,. 7 ,. 8 ,. 9 } |
2 |
3 | while true do |
4 | wait( 1 ) |
5 | script.Parent.Transparency(math.random(#trans)) |
6 | end |
You have to place and = sign after Transparency since it's a number value. Tables are also no refereed that way, you can see more about tables here: http://wiki.roblox.com/index.php?title=Table and math.functions here: http://wiki.roblox.com/index.php?title=Function_dump/Mathematical_functions#math.rad
1 | trans = { 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 } |
2 | while true do |
3 | wait( 1 ) |
4 | script.Parent.Transparency = trans [ math.random( 1 , 9 ) ] |
5 | end |
Dont forget to +1 :D