how to make an npc spawner?
Asked by
4 years ago Edited 4 years ago
ok so i got the spawner it is just that i only want it to spawn the npc when the previous one has died this is my current script so far:
1 | local guards = game.ReplicatedStorage.Guards |
3 | for _,i in pairs (guards:GetChildren()) do |
4 | local clone = i:Clone() |
5 | clone.Parent = workspace.Guards |
6 | clone.Humanoid.Died:Connect( function () |
game.ReplicatedStorage.Guards is a folder that contains a lot of guards or at least is going to rn it only has one so right now i don't even think this will work because once the loop has finished im not sure if it will even run when it dies and second im not sure what to put when the thing has died because i would put local clone = bla bla bla then i would put clone.hum.died:connec and in that i would have to put that in and do that forever and ever so is there any way to fix those two problems? i was thinking i could fire a remote event but i would need to fire it back agian in a client cause there both in server anyway is there any way to fix this?