Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Random transparency not working? {Not Solved}

Asked by 10 years ago

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.

trans = {.1,.2,.3,.4,.5,.6,.7,.8,.9}

while true do
    wait(1)
    script.Parent.Transparency(math.random(#trans))
end
0
Get rid of trans and just do math.random() default is 0-1 DragonSkyye 517 — 10y

1 answer

Log in to vote
2
Answered by 10 years ago

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

trans = {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}
while true do
    wait(1)
    script.Parent.Transparency = trans[math.random(1,9)]
end

Dont forget to +1 :D

0
I didn't want 1 second, now i have to delete like 15 scripts. Grenaderade 525 — 10y
1
...You put it, next time explain your problem better. Orlando777 315 — 10y
0
Can he just change the wait time.... raspyjessie 117 — 10y
Ad

Answer this question