Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

When Player dies, model is removed. Only that I can't get it to work. Can someone find an answer?

I want it so when a Zombie kills a player, the Zombie will get removed.(zombie is in a model) So when the Zombie kills the player, I need it to die because this is kind of like Temple Run. You press play after each time you die. But if you die and the Zombie is not removed, the game kinda falls apart. So what I need is when the player dies, the zombie is removed.

if game.Player.Humanoid < 1 then
game.Workspace.Example:Remove()
end

I know the script is small but I don't know what to add to it to make it work.

1 answer

Use Humanoid's .Died event to detect when a player dies. Here is an example:

local player = workspace.Player1

player.Humanoid.Died:connect(function()
print("Player has died!")
end)

1 comment

0

The zombie stayed alive and did not get removed when I added game.Workspace.Example:Remove()

This discussion is preserved as it was. New answers, comments, and votes are closed.