Unable to cast double to CoordinateFrame

I am trying to move the model to a random location, but the error message in the title appears instead. I’d love some help.

Model:PivotTo(math.random(-100, 100), Model.WorldPivot.Y, math.random(-100, 100))
	
1 Like
Model:PivotTo(CFrame.new(math.random(-100, 100), Model.WorldPivot.Y, math.random(-100, 100)))

You gave the PivotTo method 3 doubles (doubles are just numbers), instead of a CFrame. The code above should fix it.

Documentation:

3 Likes

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