local newNumber = function(range)
local minimum = range[1];
local maximum = range[2];
return math.random(minimum, maximum)
end
while true do
task.wait(20)
print(newNumber({100, 999}));
end
local function newNumber()
local number = math.random(100,999)
print(number) -- puts number to your output log
end
while true do
task.wait(20)
newNumber()
end
local newNumber = function(range)
local minimum = range[1];
local maximum = range[2];
return math.random(minimum, maximum)
end
while true do
task.wait(20)
print(newNumber({100, 999}));
end
Right that’s because the function newNumber doesn’t return anything so print won’t print anything since you are feeding it nothing. you can change the variable declaration to a return.
local function newNumber()
return math.random(100,999)
end
while true do
task.wait(20)
print(newNumber())
end