Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I've made a Model and i want to know... how do i make a model spawn in a random place?

I've made a model and i want to know how to spawn a model in a random place around a map. does it go with?

local .. math.random() or is it something else?

1 answer

✓ Accepted answer

Well, I made it so it spawns anywhere. If it was my place this script would be inserted into, I would specify within which area it should spawn. Here's you're script fixed up:

game.Workspace.Model:MoveTo(Vector3.new(math.random(),math.random(),math.random()))

Here's my opinion

game.Workspace.Model:MoveTo(Vector3.new(math.random(1,100),0,math.random(1,100)))

I made it so it can spawn on the X axis between 1 and 100, the Y axis at 0 (Don't want it floating) and the Z axis between 1 and 100.

2 comments

0

how about height?

0

The Y axis is height. You could make it "math.random(1,10)" because I don't think you'd want it to randomly be in space. The Y axis is where the "0" is by itself.

This discussion is preserved as it was. New answers, comments, and votes are closed.