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: Kill all players

Previous Thread :: Next Thread 
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
16 Nov 2011 07:18 PM
how would i kill every single player in my place at a time? (Via script)
Report Abuse
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
16 Nov 2011 07:20 PM
while wait(2) do
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Humanoid.Health = nil
end


i would tell u no requests but it was to easy lol.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
16 Nov 2011 07:43 PM
This is murder. I shall not participate in programming such a violent thing.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
16 Nov 2011 07:43 PM
for _,p in pairs(game.Players:GetPlayers()) do
if (p.Character) then
p.Character:BreakJoints()
end
end
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
16 Nov 2011 07:45 PM
Lol, says the guy who makes the airplanes who shoot down and kill other players.
*cough* Perilous skies
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
16 Nov 2011 08:22 PM
@josh

forgot another end.
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
16 Nov 2011 08:37 PM
'This is murder. I shall not participate in programming such a violent thing.'

You'r hilarious Crazyman32. You create games where you kill each other. Lol.
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
16 Nov 2011 08:37 PM
You're* sorry for my grammer.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
16 Nov 2011 08:39 PM
Well, mine has reason to it. Obviously if you get hit by a giant missile, you're not going to survive. Just scripting sudden death is taking the laws of nature too far. "Some things in nature should just be left alone" -(Forget who said this).

:P
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
16 Nov 2011 08:44 PM
Very true lol. By the way, good luck on your Stranded game.
Report Abuse
DrSocca is not online. DrSocca
Joined: 06 Nov 2011
Total Posts: 23
16 Nov 2011 08:44 PM
^ Yes, at least he gives them a chance to survive, instead of just slaughtering them. ^^thank you for not just decreasing the health, and instead of brutal killing you broke the joints :D
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
17 Nov 2011 04:27 AM
for _, player in pairs(game.Players:GetPlayers()) do
  if player.Character then
    player.Character:BreakJoints()
  end
end
Report Abuse
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
17 Nov 2011 07:57 PM
thanks crazy, above, and second post.

:D

yeah, good luck on stranded.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
17 Nov 2011 07:59 PM
YOU MONSTER.

Why does everyone use "_" as a variable for index? it's ugly.

for index,child in pairs(game.Players:GetPlayers()) do
if child.Character then
child.Character:BreakJoints()
end
end)
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
17 Nov 2011 09:50 PM
@nate890 - Because all the tutorials, including the lua.org site, demonstrate it as that. I do it when showing stuff on here since that's how most people learn
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
17 Nov 2011 09:52 PM
I don't see how _ can represent index
Report Abuse
Jagger19 is not online. Jagger19
Joined: 14 Jun 2008
Total Posts: 1877
17 Nov 2011 10:18 PM
Because it works?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
18 Nov 2011 06:28 AM
^Yes, but it doesn't seem like a proper variable name.
Report Abuse
oxcool1 is not online. oxcool1
Joined: 05 Nov 2009
Total Posts: 15444
18 Nov 2011 06:52 AM
[ Content Deleted ]
Report Abuse
Pyzothon is not online. Pyzothon
Joined: 26 Oct 2011
Total Posts: 822
18 Nov 2011 07:00 AM
I agree with nate. Why use an underscore as a variable? I personally like using identifiers that relate to what I'm doing.

    local tabul = {1, 2, 3}
    for index, value in pairs(tabul) do
        print(index.." : "..value)
    end
Report Abuse
Pyzothon is not online. Pyzothon
Joined: 26 Oct 2011
Total Posts: 822
18 Nov 2011 07:00 AM
@oxcool

And since when is it unused? I use it all the time.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
18 Nov 2011 07:22 AM
"Why does everyone use "_" as a variable for index? it's ugly."

You don't get it.
I use "_" as the name for variables I am not going to use but I am forced to declare. If I have to give a name to a variable that I won't use, then I use "_". In this case, I HAVE to choose a name for the variable that will contain the index, even if I'm not going to use the value it contains. So that's the reason I use "_".

Another use of it would be this:
suppose I need to know the values returned by a function ran with pcall, but I don't care about if the function ran or not, then, the first value returned by pcall will be useless, even though I have to put it in a variable, in order to get the other values. In that case, I will use "_" as the variable's name.

However, people that choose "_" as a variable name and then use it in for loops definitively didn't understand what is the point of using "_" as a variable name...

Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
18 Nov 2011 07:23 AM
If you are iterating through a table and you need the value but not the index, you still have to store the index somewhere. So you just store it in "_".

If you're going to use the index, then you store it in a normal variable, not in _, of course... T_T
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
18 Nov 2011 02:42 PM
Eh, so it's used to occupy empty, useless space (for the most part)
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
18 Nov 2011 03:21 PM
How does josh script works -=-
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