|
| 09 Aug 2012 04:31 PM |
| Would it be setting the player health to 0 or :BreakJoints etc? |
|
|
| Report Abuse |
|
|
lucas668
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 6183 |
|
|
| 09 Aug 2012 04:33 PM |
| Workspace.Character.Head:Destroy() |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 09 Aug 2012 04:37 PM |
| I doubt removing the head is very efficient. It may break badly written scripts that are working with the head. I think setting the health to 0 would be a better idea. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 04:37 PM |
Player:RemoveCharacter()
If only... |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 09 Aug 2012 04:42 PM |
| Setting the head's parent to nil would be my best answer to this. You don't have to call a method for it and it gets (pretty instantly) garbage collected internally if I know anything about how characters work. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 04:52 PM |
| Workspace.YOURNAMEHERE.Head:Remove() i think this is good |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 04:53 PM |
@dark
*facedesk* *facepalm* *facebook*
get.
out. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 05:47 PM |
pcall(function() Humanoid.Health = 0 end)
?
☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☜☆☞▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ - Candymaniac, a highly reactive substance. |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 09 Aug 2012 06:49 PM |
| Players.Player.Character:BreakJoints() |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 09 Aug 2012 06:50 PM |
@pwned
You're using a method, instantly less efficient. |
|
|
| Report Abuse |
|
|
NikB
|
  |
| Joined: 13 May 2009 |
| Total Posts: 2478 |
|
|
| 09 Aug 2012 06:56 PM |
I understand why people need more efficient scripts but why do you need to kill people?
It only really matters if you want to kill hundreds of people at once, since it takes the a few seconds to respawn. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 07:54 PM |
I think either: 1. Removing their head: game.Workspace.USERNAME.Head:Destroy() or 2. Setting their health to 0: game.Workspace.Humanoid.Health = 0
I think I may have missed something in there, so sorry, I'm jus a beginning scripter.. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 07:55 PM |
"game.Workspace.Humanoid.Health = 0"
no, for so many reasons. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 08:00 PM |
"You're using a method, instantly less efficient."
Roblox uses meta-methods to check for changes when you assign a value to a property. You're using a method either invisibly or visibly. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 08:51 PM |
This is how is should be done:
game.Workspace.Player.Humanoid:TakeDamage(100)
because why not |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 08:54 PM |
| Because I just set the humanoid's health to 101 and because that checks for forcefields before doing damage. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 09:01 PM |
| game.Players.PlayerName.Character.Parent = nil. Gets rid of all the hassle of moving parts and stuff |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 09 Aug 2012 09:12 PM |
@popinman
You don't have to call a Lua method (let's just call it a function call, because that's what methods are) though. I'm sure that changing properties is deeper in the code (like the C-side of things), amirite? |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 09 Aug 2012 09:15 PM |
| @aboy It would fire events like Changed, too. |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 09 Aug 2012 09:17 PM |
| We're really getting into micro-optimizing now.... Let's stop. It's a pointless argument because we're not writing the C code which is where all of the improvements seem to be. |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 09:19 PM |
Player:LoadCharacter()
It's so efficient that the player respawns instantly before even realizing what is going on! |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 09 Aug 2012 09:20 PM |
| That is true. Plus, it's not like he's going to be killing thousands of people in less than a second. Unless........ ... |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 09:25 PM |
@jAlternate
Isn't LoadCharacter locked? |
|
|
| Report Abuse |
|
|
NikB
|
  |
| Joined: 13 May 2009 |
| Total Posts: 2478 |
|
|
| 09 Aug 2012 09:41 PM |
| Maybe he wants 10000 AI bots and is making a nuke script? |
|
|
| Report Abuse |
|
|
OwneD1991
|
  |
| Joined: 16 Oct 2009 |
| Total Posts: 12623 |
|
| |
|