#Spawning parts randomly inside a set area/range
10 messages · Page 1 of 1 (latest)
So the length is 212 & the width is 209?
Am I right?
Actually the length is both 212 and 209
I think
yeah
I'm going to give you an idea on how to summon parts with random positions. And I'll let you work with the other components.
local XAxis = math.random(212, 213)
local ZAxis = math.random(209, 210)
for i=0, 10, 1 do -- meteor spawns
local newPart = instance.new("Part", workspace)
newPart.Size = vector3.new(20,15,20)
newPart.Name = "Meteor"
newPart.Position = vector3.new(XAxis, 20, ZAxis)
wait(1)
end
Idk if the Math.random should be inside the for loop
But if it doesn't give new positions just switch the XAxis & ZAxis place inside the for loop
math.random should be inside the loop. Otherwise parts will spawn in the same position because XAxis and ZAxis won't change