How do I fix attempt to index nil with 'GetPivot'

Hi!
I need help with this error attempt to index nil with ‘GetPivot’ idk how to fix it .
I want the model to spin, if anyone knows how to fix it pls help!
The subject is a model,
here is the script:

local function spin(Subject)
	while true do
		Subject:PivotTo(Subject:GetPivot() * CFrame.Angles(0, math.rad(15), 0))
		wait(0.01)
	end
end
return spin()

any help is appreciated!

I assume this is a module script so make sure when returning to remove the () :smiley:

local function spin(Subject)
	while true do
		Subject:PivotTo(Subject:GetPivot() * CFrame.Angles(0, math.rad(15), 0))
		wait(0.01)
	end
end
return spin
2 Likes

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