So i want to create a weighted distribution system in my game but it needs to work a little different to the normal ones. However i am trying to use a for loop to add all the values in a table but its just not working
Anyone know if im doing something wrong? Also the rounding function just rounds the numbers and ive tested it and its working just fine
My bad, I skimmed your code too fast and missed the ipairs. @h_pup mentioned your solution above where you can either use a dictionary instead of an table or switch the ipairs out for pairs.
for i, v in pairs(room) do --> Substituded ipairs -> pair
weight += 2
print(v)
end