I think the title says it all, I need a script that creates a table with numbers and picks the highest value of that table.
✓ ANSWER ACCEPTED
How do I make a script that gets the biggest value on a table?
1 answer
✓ Accepted answer
local randomOrder = {
0,5,6,23,43,23,2,2153,2,5
}
local largest = 0
for _, v in pairs(randomOrder) do
if v > largest then
largest = v
end
end
print(largest) -- 2153
just assigning largest to the other largest... checking if each number is greater than each other...
Click accept if this helps, thx
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Thanks alot bud!
OH SWEET 3 UPVOTES!!! Also, you are welcome
Forgot to accept answer, oops.
it's ok