Hello everyone,
I am trying to make a respawn script for an AI in my game but for some reason neither the “HealthChanged” nor the “Died” events are firing at all from the main humanoid.
Here is my code:
local model = script.Parent:Clone()
local orig = script.Parent
local hum = model.Humanoid
local function died()
task.wait(5)
model.Parent = workspace.Entities
orig.Scripts:Destroy()
orig:Destroy()
end
hum.Died:Connect(function()
died()
end)
I know for a fact the event isnt firing at all because I tried a print statement before any other code is executed within the connected function and it was never output to the console.