How to prevent Negative Arguements being sent through console


Run a couple of checks like this:

if tonumber(args[3]) < 0 then return end
if string.find(tostring(args[3]), “-”) then return end


0 is greater then every negative number, so why would you need to check if there is a negative sign?

True, the second one is merely an alternative. A little pointless i agree, but it’s better to suggest several ways of doing something if there are.

The first one being the correct one. He is going to tonumber the argument either way. Thanks for pointing out both ways though.