dpearce
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 546 |
|
|
| 14 Jul 2014 07:20 AM |
I want all the players in game to die.... Im new at scripting so...
local bob = game.Workspace.Players:GetChildren()
bob.Torso:Destroy() |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 14 Jul 2014 07:23 AM |
| I can see this is for malicious purposes |
|
|
| Report Abuse |
|
|
dpearce
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 546 |
|
|
| 14 Jul 2014 07:25 AM |
No...
Im working on a script for my game....
It will change the team of all the players then kill them... |
|
|
| Report Abuse |
|
|
dpearce
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 546 |
|
|
| 14 Jul 2014 07:28 AM |
| Can anyone help me with this? |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2014 07:33 AM |
Well, It would work if: There is a model in Workspace named Players. Torso is a variable defined beforehand.
Here is what this looks like:
game.Workspace.Players Typically, there is no "Players" model in Workspace. But assuming there was, and there were everyone's characters in it, here is what would happen:
:GetChildren()
Now we have:
{WishNite's Character, dpearce's Character, JarodOfOrbiter's Character}
Notice Torso is not a member here, and even if we could access it, you are deleting everyone's torsos, not just bob's.
To correct the whole script for you, do this:
game.Workspace["PlayerNameHere"].Torso:Destroy()
The reason for the brackets is it works with names with spaces, and names that begin with numbers.
Last step - In case the guy's torso is already deleted or his character doesn't exist yet, the script won't break:
local Player = game.Players["PlayerNameHere"] if Player.Character and Player.Character:FindFirstChild("Torso") then Player.Character.Torso:Destroy() end
You did a good job with Lua Syntax, but your directory knowledge is what you should work on, just as a constructive criticism.
|
|
|
| Report Abuse |
|
|
dpearce
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 546 |
|
|
| 14 Jul 2014 07:39 AM |
@Jacob Thanks, but i want it to kill all the players ingame...
How about this:
local playernames = game.Players:GetChildren()
game.Workspace.playernames.Torso:Destroy() |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 14 Jul 2014 07:42 AM |
Stop spamming threads. One is enough. |
|
|
| Report Abuse |
|
|