Jump to content

[Error] '=' expected near '+'


Recommended Posts

Posted
if timeLeft >=1 then 
    for x=1, smmm, 1 do --add difference as minutes 
        x + timeLeft = totalTimeLeft 
    end 

Why is it giving me this error? timeLeft by default is set to 0. I have an equal sign in the equation.

Posted

xXMADEXx is right, programming and scripting is not written like regular math. Only 1 parameter on the left side of "=". And all variables must have a value assigned, unsigned variables will have nil which isn't a value, it's just empty space and can't be used in arithmetic operations but in this case we can't know, if that's an error too then it will appear after this first issue is resolved, outputting something similar to: "Attempt to perform an arithmetic on a nil value".

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...