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

Why does the '=' have a syntax error saying "Expected then when parsing if statment. got '='?

Why does the '=' have a syntax error saying "Expected then when parsing if statment. got '='? code:

if workspace.Timer.Value => 0 then
function leftClick()
	workspace.Classic.Value = workspace.Classic.Value + 1
	script.Disabled = true
end
script.Parent.MouseButton1Click:Connect(leftClick)

im fairly new to coding

1 comment

0

Add an extra end. You didn't add one.

2 answers

The if statement at the start of your code has no actual end. The only end you're using is ending the function inside(?) of the statement, not the statement itself. You'll need to insert an end either before the function and after the statement is defined (anywhere after the if but before the start of the function) or after the function to alleviate the issue.

Also, all conditional syntax use either >, <, or x= for number comparison, where x is either =, ~, >, or <. => is incorrect syntax.

2 comments

0

thanks but sadly i cant accept both

0

ill upvote it

in line one the symbol is =>, thats wrong i think, im pretty sure its >=

Edit: Yup i tested and got the same error, its the greater sign first then equal sign last

3 comments

0

hope this works :3

0

also yeah your missing an end it seems

0

Yea thanks, someone else gave me this answer too and it worked, but he didnt answer sio welp might as well accept yours

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