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 » Scripters
Home Search
 

Re: Detect when a player dies?

Previous Thread :: Next Thread 
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
09 Sep 2015 04:23 PM
How would you go about making a script that detects when a player dies, waits until the player respawns then preforms the code of my choice?

Report Abuse
Hvxbyte is not online. Hvxbyte
Joined: 19 Aug 2015
Total Posts: 410
09 Sep 2015 04:24 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
-- your code.
end)
end)
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
09 Sep 2015 04:25 PM
Will that work if the player dies multiple times?
Report Abuse
Hvxbyte is not online. Hvxbyte
Joined: 19 Aug 2015
Total Posts: 410
09 Sep 2015 04:25 PM
Yes.
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
09 Sep 2015 04:29 PM
Thank you
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
09 Sep 2015 04:40 PM
Not working. Here:


game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
wait(1)
print("success")
if game.Workspace.RoundInProgress.Value == true then
if player.PlayerGui.Stats.AFK == false then
character.Torso.CFrame = CFrame.new(0, 1 * 5, 0) + game.Workspace.CurrentMap.Spawn.Position
end
end
end)
end)
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
09 Sep 2015 04:41 PM
>tfw said characteradded



http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$373 Tx1,994
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
09 Sep 2015 04:42 PM
Learn to use the Output
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
09 Sep 2015 04:48 PM
There was no error message in the output.

I'm not an idiot
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
09 Sep 2015 04:52 PM
if player.PlayerGui.Stats.AFK == false then

if player.PlayerGui.Stats.AFK.Value == false then

?
Report Abuse
extremeninjamaster is not online. extremeninjamaster
Joined: 25 Feb 2012
Total Posts: 2570
09 Sep 2015 04:55 PM
lol yeah i think that's it

I keep forgetting to do.Value lol
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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