Making a model spin a few times

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to make this truck model I made spin like this

  2. What is the issue? It just rotates 180 degrees and stops

  3. What solutions have you tried so far? I tried doing

local TruckRotate = game:GetService('TweenService'):Create(Truck.PrimaryPart, TweenInfo.new(0.8, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0), {CFrame = Truck.PrimaryPart.CFrame * CFrame.Angles(0,math.rad(180*3),0)})

Which should make him spin 180 degrees 3 times
This is whats happening:

1 Like

WOW, your game lighting, music and models really does Mach well.
BTW here try this :smiley:

local part = script.Parent
local rotations = 3 -- Number of times to rotate the part
local degreesToRotate = 180 -- Degrees to rotate the part each time
local rotationTime = 1 -- Time in seconds for each rotation

local tweenInfo = TweenInfo.new(rotationTime, Enum.EasingStyle.Linear)

for i = 1, rotations do
	local rotationGoal = part.Orientation + Vector3.new(0, degreesToRotate, 0)
	local tween = game:GetService("TweenService"):Create(part, tweenInfo, {Orientation = rotationGoal})
	tween:Play()
	tween.Completed:Wait()
end

TweenInfo has a repeatCount which esentially does the same.

this kind of works, but not like i want