generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Function On Killed?

Previous Thread :: Next Thread 
stuntman9472 is not online. stuntman9472
Joined: 25 May 2008
Total Posts: 7381
07 Feb 2010 04:45 PM
How do you make a function that triggers when a player dies?

Thanks,
stuntman9472
Report Abuse
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
07 Feb 2010 04:46 PM
using a connection 0.o
Report Abuse
Glicon is not online. 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
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
07 Feb 2010 05:34 PM
game.Players.PlayerAdded:connect(function(new)
new.Character.Humanoid.Died:connect(char)
--blah
end)end)
Report Abuse
stuntman9472 is not online. stuntman9472
Joined: 25 May 2008
Total Posts: 7381
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
abbymcabby is not online. abbymcabby
Joined: 03 Apr 2009
Total Posts: 2402
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
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
08 Feb 2010 04:50 PM
@abby

way to steal tdog's script XD
Report Abuse
nickmaster24 is not online. nickmaster24
Joined: 04 Oct 2008
Total Posts: 8906
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
stuntman9472 is not online. stuntman9472
Joined: 25 May 2008
Total Posts: 7381
08 Feb 2010 04:51 PM
I need it for all players.
Report Abuse
abbymcabby is not online. abbymcabby
Joined: 03 Apr 2009
Total Posts: 2402
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
stuntman9472 is not online. stuntman9472
Joined: 25 May 2008
Total Posts: 7381
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
nickmaster24 is not online. nickmaster24
Joined: 04 Oct 2008
Total Posts: 8906
08 Feb 2010 04:52 PM
Ohh
Report Abuse
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
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
stuntman9472 is not online. stuntman9472
Joined: 25 May 2008
Total Posts: 7381
08 Feb 2010 05:18 PM
I'm gonna see if that works, tomorrow. Cuz I gotta go.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image