If I have a position of -222.364, 3.75, 1082.273
and size of 937, 0.5, 1026.11
. How do I make it so that objects will spawn within this radius? This is a platform
local Orange = game.ServerStorage:WaitForChild('Orange') math.randomseed(tick()) for _ = 1, 500000 do local NewOrange = Orange:Clone() NewOrange.CFrame = CFrame.new(math.random(-2048, 2048),math.random(20, 50),math.random(-2480,2048)) wait(1) NewOrange.Parent = game.Workspace:WaitForChild('Oranges') end
Thank you for any support or feed back
-- your Orange, BlackOrange3343.
If you are looking for a part to spawn anywhere inside the brick, you'd use this
local Orange = game.ServerStorage:WaitForChild('Orange') math.randomseed(tick()) local pos = Vector3.new(-222.364, 3.75, 1082.273) -- You can replace this with obj.Position local size = Vector3.new(937, 0.5, 1026.11) local halfsize = size / 2 for _ = 1, 500000 do local NewOrange = Orange:Clone() NewOrange.CFrame = CFrame.new(math.random(pos.X-halfsize.X, pos.X+halfsize.X),math.random(pos.Y-halfsize.Y,pos.Y+halfsize.Y),math.random(pos.Z-halfsize.Z,pos.Z+halfsize.Z)) wait(1) NewOrange.Parent = game.Workspace:WaitForChild('Oranges') end