Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to rotate a model from Primary Part CFrame with Tweening?

Asked by 4 years ago

Trying to rotate a Model from the Primary Part's CFrame using the Tween Service. On line 12 the '}' is underlined red and when you hover over, it says "Expected ')' to close '(' on line 11, got '}'

Script:

--[VARIABLES]--

local Model       = game.Workspace.Model
local TweenService    = game:GetService("TweenService")

--[FUNCTIONS]--

function click()
    local InfoA = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
    local GoalA = {
    CFrame = Model:SetPrimaryPartCFrame(Model:GetPrimaryPartCFrame() * CFrame.fromAxisAngle(Vector3.new(1, 0, 0), math.rad(90))
    }
    local TweenA = TweenService:Create(Model, InfoA, GoalA)
    TweenA:Play()
    TweenA.Completed:Wait()
end

Part.ClickDetector.MouseClick:Connect(click)
0
Put another parenthesis line at the end of line 11 sheepposu 561 — 4y

Answer this question