This script is supposed to extract a random number between 1 and the size of an array.
The script works fine the first time, but when conducting a second time, it fails to work.
Output gave me this: "bad argument #1 to 'random' (interval is empty)"
Can someone please help me?
Here's the script:
local a = math.random(1, #Strings)
local b = math.random(1, #Strings2)
String.Value = Strings[a]
String2.Value = Strings2[b]
table.remove(Strings, a)
a = math.random(1, #Strings)
b = math.random(1, #Strings2)

1 comment
That error means that the 2nd argument is not greater than the first. Check if #Strings and #String2 are more than 1 to fix it.