BrastaSauce Posted May 3, 2014 Share Posted May 3, 2014 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. Link to comment
xXMADEXx Posted May 3, 2014 Share Posted May 3, 2014 I think you meant to put this for line 3: totalTimeLeft = x + timeLeft Link to comment
Mr_Moose Posted May 3, 2014 Share Posted May 3, 2014 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". Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now