Why does my script only work once

i tried making an script where if you die your teammate also dies however if you die it works however if you die again it doesn’t and breaks the whole system idk why

local script:
image (1)
and server script:
image (2)

Your firing to the server on the died event, yet you’re connecting the died event to a client event instead.

You should be doing on a serverscript:

DiedEvent.OnServerEvent:Connect(Paired)

The issue is in the following:

Humanoid.Died:Connect(KillAll)

The Humanoid when you respawn is different to the humanoid initially, so you basically don’t have a connection for any subsequent humanoids.

Consider doing something like this:

Humanoid.Died:Once(KillAll)
Player.CharacterAdded:Connect(function(char)
    Humanoid = char.Humanoid
    Humanoid.Died:Once(KillAll)
end)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.