Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make an item disappear from the workspace after the person that put it down has died?

Asked by 10 years ago

Okay, so I want an item to disappear from the workspace after the owner has died. But, I don't know how to rephrase the script to make it remove from the workspace. Use "C4" as an example. Like game.Workspace.c4:remove() Like, how would I rephrase it as the person who had it died? Lets say I had C4 in a game as a gear. I put down Both C4's, then I died before making it explode. I would need the C4 to be removed from the workspace. Those specific C4's put down by that specific person. How would I do that? The C4 is in lighting if you need to know.

1
This is not a request site! Actually do some research and give us some code to help fix before you ask! Bman8765 270 — 10y
0
Nope, don't know what you're talking about. I'm looking for help. Meaning I've been getting help from this site in the past. PsychoJordan 5 — 10y
0
Perhaps set the parent of the placed C4 to the Character model. When the character dies and disappears, the C4 disappears with it. Redbullusa 1580 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Use the 'died' event to do something. it fires whenever a humanoid dies

Example: (localscript in StarterGui)

Character = script.Parent.Parent.Character

        Character:WaitForChild("Humanoid").Died:connect(function()
            print "He's Dead Jim!"

end)
Ad

Answer this question