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 |
|
|
|
| 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 |
|
|
|
| 16 Nov 2011 07:43 PM |
| This is murder. I shall not participate in programming such a violent thing. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
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
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 16 Nov 2011 08:37 PM |
| You're* sorry for my grammer. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 17 Nov 2011 09:52 PM |
| I don't see how _ can represent index |
|
|
| Report Abuse |
|
|
Jagger19
|
  |
| Joined: 14 Jun 2008 |
| Total Posts: 1877 |
|
| |
|
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
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15444 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 18 Nov 2011 03:21 PM |
| How does josh script works -=- |
|
|
| Report Abuse |
|
|