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

Output says there is an ')' expected near '=' ?

Asked by 5 years ago

So I got this problem, and I do know what it means, What I don't know is where I need to put the ')'

This is my script:

local T = game:GetService("TweenService")

while true do
    wait(.7)
    T:Create(script.Parent,TweenInfo.new(.5,Enum.EasingStyle.Bounce),(CFrame = script.Parent.CFrame*CFrame.Angles(0,0,math.rad(15)))):Play()
end

Thanks for your time

1 answer

Log in to vote
0
Answered by 5 years ago

It's a syntax error.

T:Create(script.Parent,TweenInfo.new(.5,Enum.EasingStyle.Bounce),(CFrame = script.Parent.CFrame*CFrame.Angles(0,0,math.rad(15)))):Play()

(CFrame =

I can't really tell what you're trying to do, but it doesn't really make any sense to put an = there. You should probably define a cframe variable using the CFrame.new() constructor elsewhere.

For the correct syntax, see: https://www.robloxdev.com/api-reference/function/TweenService/Create

0
CFrame = is correct, not putting the CFrame.new is where its wrong aazkao 787 — 5y
0
In general it would be a preferable practice to construct the CFrame first and simply use the variable. So long as he actually uses CFrame.new() it should work (aside from the extra parentheses), but I still recommend the same advice of defining it first rather than doing it in the middle of Create(). It would make his code more readable and easier to modify, and therefore easier to debug. vanilla_wizard 336 — 5y
0
I see, thats a good point, i had a hard time identifying the brackets in his code since its so long aazkao 787 — 5y
Ad

Answer this question