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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

EASY REQUEST

Previous Thread :: Next Thread 
TheLittleEgg is not online. TheLittleEgg
Joined: 08 Feb 2012
Total Posts: 262
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 is not online. 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
TheLittleEgg is not online. TheLittleEgg
Joined: 08 Feb 2012
Total Posts: 262
14 Oct 2013 07:52 AM
doesnt work :(
Report Abuse
shawnyg is not online. 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
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
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
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
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
TheLittleEgg is not online. TheLittleEgg
Joined: 08 Feb 2012
Total Posts: 262
14 Oct 2013 09:24 AM
thx but will that only kill the player once
Report Abuse
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
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
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
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
Project2015 is not online. Project2015
Joined: 11 Sep 2013
Total Posts: 384
14 Oct 2013 09:36 AM
child.Name
Report Abuse
reptoslicerguy is not online. reptoslicerguy
Joined: 01 Jan 2010
Total Posts: 2098
14 Oct 2013 09:49 AM
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character ~= nil
player.Character:BreackJoints()
end
Report Abuse
reptoslicerguy is not online. reptoslicerguy
Joined: 01 Jan 2010
Total Posts: 2098
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
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
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
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