I am trying to get the model to spawn at a random position in the map instead of always at the center. I am using this but when I try to run it, it returns the error shown in the title.
I’m pretty sure to pivot a model, it requires a CFrame, not a vector! Also, models don’t have a position property (That’s why Model.Position.Y doesn’t work) Try this:
-- Set the primary part of the model to some part!
local TheX = math.random(-200, 200)
local TheY = Model.PrimaryPart.Position.Y
local TheZ = math.random(-200, 200)
local PositionVect = Vector3.new(TheX, TheY, TheZ)
-- Turns Position Vector into CFrame
Model:PivotTo(CFrame.new(PositionVect))