How do I make this script print the item name?
Asked by
5 years ago Edited 5 years ago
So I have this script that selects a random item in the pets table but it prints the amount of characters the name contains rather than the actual name. An example of this would be "Selected 5". I am wondering how to change this to make it print the item name. An example would be "Selected Fire Sword".
17 | for _,v in ipairs (Pets.rarities) do |
18 | totalweight = totalweight + v |
21 | local at = math.random() * totalweight |
23 | for i,v in pairs (Pets.rarities) do |
25 | print (Pets.pets [ i ] .. " has been chosen!" ) |