I want to find out how many bunny pets are in someone's character for an un-equip system. Here's my code:
local thing = player.EquipedPets:WaitForChild("Pet"..#player.Character:WaitForChild("Bunny Pet"..)) --^What can I put here that means anything? player.Character:WaitForChild("Bunny "..thing.name):Destroy()
when you equip a pet It gets named with a number, for instance if you equip a bunny pet and you already have a pet equipped then it will be named "Bunny Pet1" (that whole system works just fine) What can I put at the comment the means something like "Any Character"? (as in any letter/number)
if lukesmasher is correct then if u want to print the number then you can do
for i,v in pairs(player.Character:GetChildren()) do if v.Name:sub(1,5):match("Bunny") then print(#v) end end
i believe this will print the amount if bunny's there are in the character
edit: not sure but i think this will just print a number instead of every pet name