Content deleted Content added
try to make the functions available more reliably |
rework the number function |
||
Line 60:
function p._number(args)
-- Returns a random number
first = tonumber(args[1])
second = tonumber(args[2])
-- This needs to use if statements as math.random won't accept explicit nil values as arguments.
if first then
if second and first <= second then -- Second number cannot be less than the first, or it causes an error.
return math.random(first, second)
else
return math.random(first)▼
end
else
▲ return math.random(first)
end
▲ return math.random()
end
|