How do I automatically update 100s of old models to a new model?

Does anyone know how to write a script to automatically update an outdated model, in my example a cinema chair, with a new updated cinema chair model, in the exact same position as the old chair model.

All of my chairs are in a folder, including the new one that I want to replace all of the old ones:

I have tried to make some scripts but they are not working at all, I am a builder so scripting things isn’t really my strong point.

Any help would be much greatly appreciated, thank you for reading. :slight_smile:

Model has a function that gets the bounding box CFrame and center. You could write a script that goes through each and moves your new model to some position relative to the original.

Like @azqjanna said, but since you said scripting is not your thing I wrote it for you. You should test this in a regular script in the workspace before actually running it in the command bar, just to be sure it actually does what you want without being irreversible.

local Folder = --Folder route
local newChair = Folder["1) New Chair"]

for i,v in pairs(Folder:GetChildren()) do
	if v.Name == "Chair" then
		local Replacement = newChair:Clone()
		Replacement.Parent = Folder
		local replacementCFrame, size = v:GetBoundingBox()
		Replacement:PivotTo(replacementCFrame)
		v:Destroy()
	end
end
1 Like

Thank you so much, this worked perfectly!

I have also updated the model to a linked package so I don’t need to do this again :sweat_smile:

1 Like

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