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

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

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

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

1 comment

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!

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