|
| 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
|
  |
| 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 |
|
|
|
| 09 Sep 2015 04:25 PM |
| Will that work if the player dies multiple times? |
|
|
| Report Abuse |
|
|
Hvxbyte
|
  |
| Joined: 19 Aug 2015 |
| Total Posts: 410 |
|
| |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
| |
|
|
| 09 Sep 2015 04:48 PM |
There was no error message in the output.
I'm not an idiot |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 09 Sep 2015 04:55 PM |
lol yeah i think that's it
I keep forgetting to do.Value lol |
|
|
| Report Abuse |
|
|