Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Are there any shortcuts to determining what the highest value of a set of values is?

Asked by 8 years ago

Could you use a method that would find the highest value out of a set of multiple different values in a few short lines of code, or would you have to do it the manual way with multiple lines of code?

1 answer

Log in to vote
0
Answered by 8 years ago

You can use math.max() !!!

It returns the highest value that you provided it

local highest = math.max(3, 5, 2, 199234424)
print(highest) --199234424
0
Thank you! CoolJohnnyboy 121 — 8y
Ad

Answer this question