По сути, все правильно. Но в следующий раз задавай вопросы через "блок кода", а не скрином. Вот чуть упростил тебе, проверяй. Если не работает - отпишись
local RunService = game:GetService("RunService")
local model = script.Parent
local targetAngle = 90
local rotationSpeed = 1
local startCFrame = model:GetPivot()
local targetCFrame = startCFrame * CFrame.Angles(0, math.rad(targetAngle), 0)
local function rotateModel()
local currentCFrame = model:GetPivot()
local delta = math.min(rotationSpeed * RunService.Heartbeat:Wait(), math.deg((targetCFrame - currentCFrame).Rotation.Y))
model:PivotTo(currentCFrame * CFrame.Angles(0, math.rad(delta), 0))
if math.deg((targetCFrame - model:GetPivot()).Rotation.Y) < 0.1 then
model:PivotTo(targetCFrame)
return true
end
return false
end
local connection
connection = RunService.Heartbeat:Connect(function()
if rotateModel() then
connection:Disconnect()
end
end)