Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make bricks spawn at random on the map?

Asked by 4 years ago

This is my script in ServerScriptService:

local part = game.ServerStorage.Brick
while true do
     wait(12)
     local clone = part:Clone()
     clone.Parent = workspace
     clone.Position = Vector3.Random()
end

Of course this didn't work. Could someone please show me how to do this?

1 answer

Log in to vote
2
Answered by 4 years ago
Edited 4 years ago

Instead of Vector3.Random() it would be:

Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))

The -100 represents the lowest number it will choose from and the 100 representing the highest. You can change them to how you see fit. The reason yours did not work is because you have to specify the XYZ.

Ad

Answer this question