|
| 07 Feb 2010 04:45 PM |
How do you make a function that triggers when a player dies?
Thanks, stuntman9472 |
|
|
| Report Abuse |
|
|
| |
|
Glicon
|
  |
| Joined: 26 Feb 2009 |
| Total Posts: 981 |
|
|
| 07 Feb 2010 05:30 PM |
while true do if blah blah blah.Humanoid.Health == 0 then -- script end wait() end
would work |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2010 05:34 PM |
game.Players.PlayerAdded:connect(function(new) new.Character.Humanoid.Died:connect(char) --blah end)end) |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2010 04:45 PM |
| I want an object so it knows which player died. Ex: I make a script so that when someone dies, it says "Oh noes, [Players Name] died." I get how to do the message and all, but the function is blurry for me. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2010 04:48 PM |
i know sorta, but it wont work for all players, just for individuals put it in the player
function died() m=Instance.new("Message") m.Text="Oh noes! "..script.Parent.Name.." died!" m.Parent=Workspace wait(5) m:remove() end script.Parent.Character.Humanoid.Died:connect(died) |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2010 04:50 PM |
@abby
way to steal tdog's script XD |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2010 04:50 PM |
Can't you just do this?
function died(die) --here m=Instance.new("Message") m.Text="Oh noes! "die" died!" --to here m.Parent=Workspace wait(5) m:remove() end script.Parent.Character.Humanoid.Died:connect(died) |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2010 04:51 PM |
| I need it for all players. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2010 04:51 PM |
@B3tterTh3nU i didnt steel it, i acctually just got that from da top of mah mind o.o |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2010 04:52 PM |
| @Nickmaster, but then I'd have to insert that script to every player, which is annnnnnoying. xD |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Feb 2010 04:54 PM |
game.Players.PlayerAdded:connect(function(pp) pp.CharacterAdded:connect(function(cc) cc.Humanoid.Died:connect(function() local m = Instance.new("Message") m.Text = "Oh Mah Gawd, Insert sum text here because "..pp.Name.." just Died!!!1math.cos(0)1!!" m.Parent = workspace wait(3) m:remove() end) end) end) |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2010 05:18 PM |
| I'm gonna see if that works, tomorrow. Cuz I gotta go. |
|
|
| Report Abuse |
|
|