LUA - greater than and less than

Viewed 440

I am having problems making my new LUA code. I am making a grading system in a test game and I want to use

if Grade Value = <100 and >89 
then print("STUDENT GOT AN A!")

but it says it has an error processing the limits and I want for this to be answered.

1 Answers

(This question is better suited on SO but I'll answer it here.)

Your code is just.. wrong! The equal sign is causing the error, and it's not required.

Here's the corrected version (I'm a python programmer so the syntax might be kinda off).

if grade_value <= 100 and grade_value >= 90 then
print("STUDENT GOT AN A")
end

You may have noticed the code works differently, and that's because your current system allows 89.5 but not 100.

Related