I created a script whereas a single part is cloned to make many copies of itself and randomly spawn in different areas.
I want it to spawn randomly around a certain area, like its rain, but i dont know how to do it
This is the script
This is what the rain looks like and where its spawning around (i dont want it to spawn around this area)
This is the place i want the rain to randomly spawn around in
This is the parts cframe
I may have not been clear enough or given enough info so please tell me if i need to provide more clarification
jaymeyzy
(jaymey)
July 26, 2024, 11:38am
2
you could spawn a rainpart at a random position above the target part like this
local lowx = spawnPart.Position.X - spawnPart.Size.X/2
local highx = spawnPart.Position.X + spawnPart.Size.X/2
local lowz = spawnPart.Position.Z - spawnPart.Size.Z/2
local highz = spawnPart.Position.Z + spawnPart.Size.Z/2
local rng = Random.new()
rainPart.Position = Vector3.new(rng:NextNumber(lowx,highx), 100, rng:NextNumber(lowz,highz))
1 Like
This helped with my problem, thanks for the solution
system
(system)
Closed
August 9, 2024, 12:45pm
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.