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

Why is this script not moving the position of this model?

in the placed folder there will be models inside and I want the position of them to move. the Destroy() function but messed up my main script so I'm moving the things to the other side of the map.

game.Workspace.Bases.Blue.Placed:GetChildren().Position = Vector3.new(math.huge,math.huge,math.huge)

2 comments

0

:GetChildren() returns a table. Use a for loop to go through the table, or just destroy the parent.

0

I cant use the destroy function because it messes up my whole game also I just want it to do it once, im using a remote event

1 answer

✓ Accepted answer

Hello. The problem with your script is that :GetChildren() returns a table, so you'd be trying to change the table's position when the table doesn't have a position. You have to use an in pairs loop. The loop will loop through all the children of Placed and change its position to Vector3.new(inf, inf, inf). Try this:

for _, part in pairs(game.Workspace.Bases.Blue.Placed:GetChildren()) do 
	part.Position = Vector3.new(math.huge,math.huge,math.huge)
end

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