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

Why is there the error,"Unknown global" when I spelled something right?

Asked by 9 years ago

Ok so I'm trying to make this rain cloud script and put a script inside. Look at this block of code

while wait(25) do
    game.Workspace.Raincloudpart.Transparency = 1 
    game.Workspace.Raincloudpart.ParticleEmitter.Enabled = false  
    wait(0)
    game.Workspace.Raincloudpart.Transparency = Transparency.random()
    game.Workspace.Raincloudpart.ParticleEmitter.Enabled = true
    game.Workspace.Raincloudpart.ParticleEmitter.Rate = Rate.random() 




   end

See where it says," game.Workspace.Raincloudpart.Transparency = Transparency.random()" and,"game.Workspace.Raincloudpart.ParticleEmitter.Rate = Rate.random()"? I made sure I spelled Rate and Transparency right but it says "Unknown global 'Transparency'" and "Unknown global 'Rate'". Does anyone know what I did wrong and how I can fix it?

1 answer

Log in to vote
1
Answered by 9 years ago

There is no such thing as Transparency or Rate you have to use math.random Example:

Range from 0-1 with decimals

math.randomseed(os.time()) -- More Random
game.Workspace.Raincloudpart.Transparency = math.random()

Range from 1-10 - Integers.

math.random(1,10)

Random from 1-10 with decimals:

math.random()*10
0
Oh thanks. I was using part of my script from a game called Learn to Script..I can't wait to get working on a rain cloud system! VCRaygamma 15 — 9y
Ad

Answer this question