Trying to make a model move

I am trying to make a mimic that mimics the player and so this is the script where it transports the model of a monster to his position and transports his position to a pre set position, problem is, it doesn’t do anything, the printing makes it to 7 then stops.

GodMode = game.Workspace.RageMode
print(1)
My = script.Parent.Head.Position
print(2)
PosExamp = game.Workspace.RagePosExamp
print(3)
wait(1)
print(4)
GodMode:GetChildren().Position = My
print(5)
GodMode:GetChildren().Anchored = false
print(6)
script.Parent:GetChildren().Position = PosExamp.Position
print(7)
wait(50)
print(8)
script.Parent:GetChildren().Position = game.Workspace.SpawnLocation1.Position
print(9)
GodMode:GetChildren().Position = PosExamp.Position
print(10)
GodMode:GetChildren().Anchored = true
print(11)


It will wait 50 seconds on that wait(50) line

There are so many problems with your script that i dont even know how to begin

The GetChildren() function returns a table, so what you’re actually indexing Position and Anchored with is the table of children the model has. You’d want to use a for loop to iterate through those children to change their properties, like this for instance:

for _, v in ipairs(GodMode:GetChildren()) do
    v.Anchored = true
end

As for moving a model, make use of the PivotTo() function. Just input the CFrame of where you want that model to go, and it’ll all be moved to that position. Something like this, in your case:

GodMode:PivotTo(PosExamp.CFrame)

As @DesiredFlamingFire said just use :PivotTo(--place) as it just moves the entire model

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.