Help making a specific code

Hello Devs!, so, i was creating my first game and i decided to make an RPG, so the idea is when you kill all the enemies of a level, you get teleported to the other level, so i put all the zombies on a folder, is there a script to detect when the folder´s childs are removed/defeated and then teleport the player? Thanks for reading, and also as im new in the this im not sure abut the categories, if this is the wrong categorie let me know :wink:
Captura de pantalla (3)

2 Likes

There is a ChildRemoved event, which returns what’s removed.

Try making a script that detects whenever a child in the Zombies folder is removed, and verify it’s actually a zombie, then check if there’s still any zombies inside the folder. Once everything is all gone, teleport the player.

3 Likes

Thank you, im gonna try that :grinning:

2 Likes

You can check an amount of zombies using

#workspace.Levels.Swamp.Zombies:GetChildren()

it will return an amount of object in a zombies folder

2 Likes