Creating a Pet Table

Hey Devs,

I am currently creating a pet system for my game, and am trying to code the module script to sort the pets by rarity.

I already have folders made for which pets are which rarity, but I am not sure how I would code them into the table.

It is currently coded as:

["Exotic"] = {game.ReplicatedStorage.Pets.Exotic:GetChildren()}; for each rarity

However, whenever I print the table, there is always another table inside of the “Exotic” Table.

image

That’s because you’re putting the children of exotic in a table.

["Exotic"] = game.ReplicatedStorage.Pets.Exotic:GetChildren()

Do this instead.

1 Like