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

Is there a way to change a models position?

Asked by
Benqazx 108
8 years ago
local model = game.Lighting
local pos = game.Workspace.Pos.Position
function ontouch(hit)
if hit.Parent:FindFirstChild("Humanoid")~= nil then
        model:Clone()
        model.Position = pos
        model.Parent = game.Workspace
    end
end

i want to change a models position to somewhere else. is there a way to do that? the model has more then 20 parts in it? how can i move the whole model without having to write a change position code for each part.

1 answer

Log in to vote
1
Answered by
rexbit 707 Moderation Voter
8 years ago

You would use the :MoveTo method.

local model = game.Lighting
local pos = game.Workspace.Pos.Position
function ontouch(hit)
if hit.Parent:FindFirstChild("Humanoid")~= nil then
       local cloned =  model:Clone()
        cloned:MoveTo(xyz) -- place the values here
        cloned.Parent = game.Workspace
    end
end

Ad

Answer this question