Receiving Error Message

Hey guys so basically I am getting an error message when it doesn’t really make sense because it runs the code and works. It seems like it realizes its wrong and then buffers the game for debugging.

This is the error message:

Here is the code that is causing it:

newModel:PivotTo(CFrame.new(partsFolder:FindFirstChild('WhereToSpawn').CFrame.Position))

And here is what the Explorer looks like:
Screenshot 2024-10-04 at 4.51.48 PM

I’m not sure why you’re creating a new CFrame object. Your WhereToSpawn part already has a CFrame value that can tell your newModel where to go.

-- MODIFIED
local WhereTo_Spawn = partsFolder:WaitForChild("WhereToSpawn") -- If you get a yield warning, then something is wrong.
newModel:PivotTo(WhereTo_Spawn.CFrame)

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