Can some one help me create a script which will clone a model and put it in a random spot? or maybe help me with the clone it on top of a random voxel or location.
randomlocation = for I = 1 randomlocation = math.random(2044, 252, 2044) model = game.ServerStorage.ShadowEnemy copy =game.ServerStorage.model:clone-- messed up copy.parent = game.Workspace copy.Postion = randomlocation end
workspace.Model:clone():MoveTo(Vector3.new(math.random(-1000, 1000), 0, math.random(-1000, 1000)))
So, what you need to start out with is cloning the model,
model = game.Lighting.Modely:clone() -- Location model.Parent = game.Workspace -- Parent it model:MakeJoints() -- Keep it from breaking apart
Then you need to position it using :MoveTo() and math.random():
model:MoveTo(Vector3.new(math.random(-512,512), 5, math.random(-512,512))) -- Modify the ranges and the y to your liking
So all together:
model = game.Lighting.Modely:clone() -- Location model.Parent = game.Workspace -- Parent it model:MakeJoints() -- Keep it from breaking apart model:MoveTo(Vector3.new(math.random(-512,512), 5, math.random(-512,512))) -- Modify the ranges and the y to your liking