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

how do i use >= or > in a script, it wont work already?

2 answers

>= means Greater than or equal

2 >= 3? No, false.

3 >= 3? Yes, true.

4 >= 3? Yes, true.

> means Greater than

3 > 3? No, false.

4 > 3? Yes, true.

local one = 1
local two = 2

if one >= two then
    print("One is greater than or equal to two") -- Of course not
elseif one < two then
    print("One is less than two") -- Yes, one is less than two
end

Well, here we go.

  • print is a function, not a keyword. Either you forgot how it works or you script in Python.

  • The sign ">" means "greater than" and is used mostly in conditional statements:

num1 = math.random(1,10)
num2 = math.random(1,10)
if num1 > num2 then print("Bigger number")
if not num1 > num2 then error("Number not bigger")
  • The sign ">=" means "greater than or equal to" and works the same as ">" except that a number being compared can also be equivalent to its counterpart:
num1 = math.random(1,10)
num2 = math.random(1,10)
if num1 >= num2 then print("Match")
if not num1 >= num2 then error("No match")

1 comment

0

You're missing some ends

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