Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Spinning a model?

I tried too let spinning a model but it won't work. whats wrong?

while true do
	script.Parent:SetPrimaryPartCFrame(ClassName("Model").CFrame * CFrame.fromEulerAnglesXYZ(0,0.01,0)) 
	wait(0.001) -- time for add more lines
end

1 answer

✓ Accepted answer

To spin a model, you have to use the SetPrimaryPartCFrame function. This allows you to set the CFrame of the model. If you use this function along with the GetPRimaryPartCFrame function, then you can multiply that value by an angular offset.

--Define your model
local model = workspace.Model
--Define your offset
local offset = CFrame.Angles(math.rad(5),0,0)

while wait() do
	--Set the CFrame
	model:SetPrimaryPartCFrame(
		--Get current CFrame
		model:GetPrimaryPartCFrame()
		--Multiply by offset.
		* offset
	)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.