Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Random transparency not working? {Not Solved}

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

1 comment

0

Get rid of trans and just do math.random() default is 0-1

1 answer

✓ Accepted answer

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

3 comments

0

I didn't want 1 second, now i have to delete like 15 scripts.

1

...You put it, next time explain your problem better.

0

Can he just change the wait time....

This discussion is preserved as it was. New answers, comments, and votes are closed.