#Getting random item from array not working right

1 messages · Page 1 of 1 (latest)

mighty lava
#

Getting random item from array not working right

#

I've tried pick_random() but I get the exact same results

I'm trying to get a random item from the available_upgrades array which is just a dupelicate of Upgrades.upgrades, and after getting one, I remove the picked upgrade from available_upgrades.

If available_upgrades has 0 elements, set it back to a dupelicate of Upgrades.upgrades and pick random and remove again.

But for some reason, somehow, it's returning null. Did some debugging it still returns null when the array has elements in it