Idea The idea of this script is to get the object Statue
and move it to a location within the specified area.
Problem The problem is that I get the error MoveTo is not a valid member of Part
Code:
local model = game.Workspace.Treasure2.Statue local minTime = 1 local maxTime = 1 local xPos = {-6.5, 28.5} local yPos = {0.5, 0.5} local zPos = {-22.5, 2.5} while wait(math.random(minTime, maxTime)) do local m = model:Clone() local x = math.random(xPos[1], xPos[2]) local y = math.random(yPos[1], yPos[2]) local z = math.random(zPos[1], zPos[2]) m:MoveTo(Vector3.new(x,y,z)) end
local model = game.Workspace.Treasure2.Statue local minTime = 1 local maxTime = 1 local xPos = {-6.5, 28.5} local yPos = {0.5, 0.5} local zPos = {-22.5, 2.5} while wait(math.random(minTime, maxTime)) do local m = model:Clone() local x = math.random(xPos[1], xPos[2]) local y = math.random(yPos[1], yPos[2]) local z = math.random(zPos[1], zPos[2]) m.Parent = game.workspace m.Position = Vector3.new(x,y,z) end
1) It's m.Poistion
2) For some reason, I have to make the clones parent workspace, or it doesn't work.
From what I can see you need to do move to for the model not the part. So do m.Parent:MoveTo