Hi, I'm sure that this kind of question has been asked before, but I don't know the right terms to search it up. I struggle to understand things like threads and things like that.
I'm trying to make a rain-like script. It's probably inefficient, but thats part of the learning experience.
while ( true ) do
local droplet = Instance.new( "Part" )
droplet.Parent = workspace.Rain
droplet.Name = ' droplet '
droplet.CanCollide = false
droplet.Size = Vector3.new( 0.2, 1, 0.2 )
droplet.Position = Vector3.new( math.random(0,10), math.random(0,10), math.random(0,10) )
droplet.Velocity = Vector3.new ( -10, 0, 0 )
droplet.Orientation = Vector3.new( 0, 0, -40 )
droplet.Color = Color3.fromRGB( 91, 135, 217 )
droplet.Transparency = 0.64
droplet.Touched:Connect( function ( collided )
if ( collided.Name == ' droplet ') then return end
print('Splash!')
-- A wait() will probably be inserted here later to wait for the droplet to partially insert itself into the ground, instead of instantly vanishing.
droplet:Destroy()
end )
wait ( math.random( 0.001, 0.05 ) )
end
The problem is that that when I try to wait() before creating a new instance of a droplet, it will suspend all other droplets which are in the air at that time. I don't know how to get around this.
I've tried looking at things like delay() and spawn(), but I cannot get it to do what I want.

2 comments
Thank you! I think I may have been thinking about it the wrong way. I think the reason they appeared suspended in mid air was because I had their position on the Y axis randomized, and when they first spawn in they appear frozen. Sorry for the inconvenience!
No problem (: