Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to detect if in folder are 2 items same name???

I have Egg hatch but i need only 1 pet, if i get same pet again how to delete it?

2 comments

0

This is not a request site

0

I need script for deleting idk how to make it

1 answer

✓ Accepted answer

It would be best to have done some research on this first, since this is not a request site. But you can do something like this

When you chose the pet, get the name of the pet:

if player.Folder:FindFirstChild(pet.Name) then
      -- here, you can either decide to delete the pet already in the folder, or just not give the pet. If you wanted to delete the one in the folder:
      player.Folder:FindFirstChild(pet.Name):Destroy()
end

Hope this has been of help, if so, please accept this answer :)

This discussion is preserved as it was. New answers, comments, and votes are closed.