I have a random rain generator, but everytime it turns on, the rain doesnt appear, even thought the script for it is in the correct place. If I place the script directly into there, it does work.
Is my code not correct for this, or do scripts not work if you move them into the place where you want them to activate?
wait (10)
random = math.random(1,100)
if random > 0 and random < 100 then
workspace.Rain.Sky.Parent = game.Lighting
workspace.Rain.RainScript.Parent = game.StarterPlayer.StarterPlayerScripts --Moves the Sky, rain and droplets into the starterscripts, where they should
workspace.Rain.ScreenRain.Parent = game.StarterPlayer.StarterPlayerScripts --activate and cause rain to appear
end
wait (20)
random = math.random(1,100)
if random > 0 and random < 100 then
game.Lighting.Sky.Parent = workspace.Rain
game.StarterPlayer.StarterPlayerScripts.ScreenRain.Parent = workspace.Rain --Moves the Sky, rain and droplets back to their original location
game.StarterPlayer.StarterPlayerScripts.RainScript.Parent = workspace.Rain
end

3 comments
what place you moved it to?
Certain Scripts can only run in certain environments, moving a LocalScript anywhere but a descendant of an Object pertaining to the Client, will not work.
I moved it from a part, into the StarterPlayerScripts, where it should work. How else can I make it turn on/off at certain times?