so, I have an array with about 10.000 Words and I try to pull them out in a random order. But as soon as my index gets over around 2000 my script returns nil.
I tried out this solution:
return Array[index]
and a workaround:
for i, v in pairs(Array) do
if i == index then
return v
end
end
Both of them did not work after a certain index is reached.
Any ideas how I could make this work without splitting the one array in multiple?
PS: I need the word almost instantly after request. I can’t allow any time over 1 sec for the word to be returned.
Thanks for your reply!
Anyway, I figured, that the problem was actually the big size of my Array. The script didn’t manage to give me the word before it returned. As a result, it returned nil.