Respawn script for my enemy npcs doesn't work as I would like it to?
So, I have an enemy setup wherei t moves back and forth, and if you jump on it's head, it dies.
I have a respawn script so after 5 seconds of it being dead, it respawns, however, when it respawns the scripts I have set for it fail, for example, when I jump on its head it doesn't die, and it doesn't move back and forth like it used too.
02 | local clone = workspace.Goomba:Clone() |
04 | workspace.Goomba.Humanoid.Died:connect( function () |
06 | workspace.Goomba:Destroy() |
07 | clone.Parent = workspace |
08 | local clone = workspace.Goomba:Clone() |
3 | local h = game.Workspace.Goomba:findFirstChild( "Humanoid" ) |
9 | script.Parent.Touched:connect(OnTouched) |
3 | script.Parent.Goomba.Humanoid:MoveTo(Vector 3. new( 0.776 , - 0 , - 20.173 )) |
5 | script.Parent.Goomba.Humanoid:MoveTo(Vector 3. new( 0.776 , - 0 , - 33.173 )) |
This is kinda urgent! Any help appreciated