local RP = game.ReplicatedStorage
local Directory = {
Pets = {
["Dog"] = {
Name = "Dog",
Rarity = "Common",
Level = "1"
},
["Cat"] = {
Name = "Cat",
Rarity = "Common",
Level = "1"
}
}
}
RP["OpenEgg"].OnServerEvent:Connect(function(plr, arg1, arg2)
local Pet = Directory.Pets[math.random(1, #Directory.Pets)]
print(Pet)
end)
its telling me #Directory.Pets is 0 when it clearly isnt

2 comments
These answers are horrible, feel bad for you man, try #Directory.Pets:GetChildren()
greatneil80 thats wrong^ and answer -> https://scriptinghelpers.org/questions/16807/how-do-i-get-a-random-number-from-a-dictionary