|
| 14 Oct 2013 07:37 AM |
i want a script that kills someoen once they join a game
so only kill the once when they join the game
no more than once so like this
player joins game player dies player acts like nothing happened and plays the game
why do i want this? theres some bug with my guis they only work once a player has died he/she only has to die once and they'll work perfectly throughout the entire game |
|
|
| Report Abuse |
|
|
shawnyg
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 1428 |
|
|
| 14 Oct 2013 07:40 AM |
wait() game.Players.PlayerAdded:connect(function(plr) plr.Character.Humanoid.Health = 0 end)
~Hope I helped, if you need a script, PM me first then buy this when I tell you to: http://www.roblox.com/My-Script-Shirt-item?id=118961994~ |
|
|
| Report Abuse |
|
|
| |
|
shawnyg
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 1428 |
|
|
| 14 Oct 2013 07:57 AM |
function onPlayerEntered(newPlayer) newPlayer.Character.Humanoid.Health = 0 end
game.Players.ChildAdded:connect(onPlayerEntered)
Try?
|
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:19 AM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) if char:findFirstChild("Humanoid") then char.Humanoid.Health = 0 end end) end) |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:19 AM |
Or this..
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) char:WaitForChild("Humanoid") -- Waits for the humanoid. char.Humanoid.Health = 0 end end) end) |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:24 AM |
| thx but will that only kill the player once |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:31 AM |
game.Players.PlayerAdded:connect(function(player) player.Character:WaitForChild("Humanoid") if player.Character:findFirstChild("Humanoid") then player.Character.Humanoid.Health = 0 end end) |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:33 AM |
Or... game.Workspace.ChildAdded:connect(function(child) if game.Players:FindFirstChild(child) ~= nil then player = game.Players[child] player.Character:breakJoints() end end)
~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~ |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Oct 2013 09:49 AM |
game.Players.PlayerAdded:connect(function(player) repeat wait() until player.Character ~= nil player.Character:BreackJoints() end
|
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 09:50 AM |
game.Players.PlayerAdded:connect(function(player) repeat wait() until player.Character ~= nil player.Character:BreakJoints() end -- typo :P |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2013 07:07 PM |
Sorry. Early morning error.
game.Workspace.ChildAdded:connect(function(child) if game.Players:FindFirstChild(child.Name) ~= nil then player = game.Players[child.Name] player.Character:breakJoints() end end)
~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~ |
|
|
| Report Abuse |
|
|