|
| 29 Apr 2012 06:50 AM |
script.Parent.Touched:connect(function(_o) pcall(function() _o.Parent['Humanoid']:TakeDamage(100) end) end)
(BTW VISIT MAH PLACE PLZ) |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 29 Apr 2012 06:52 AM |
why not just:
script.Parent.Touched:connect(function(_o) pcall(function() _o.Parent['Humanoid'] = 0 end) end)
Warning: it might not work because i cant script. |
|
|
| Report Abuse |
|
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 Apr 2012 07:15 AM |
| Just checking does humanoid exist is more efficient than pcall |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 29 Apr 2012 07:17 AM |
"Just checking does humanoid exist is more efficient than pcall"
Really, too many people seem to care about efficiency in these situations where it does not make much of a difference - if any at all. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 Apr 2012 07:18 AM |
It doesn't matter if there's only a small difference.. It's still faster :PP |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 Apr 2012 07:20 AM |
| And especially if you're making some sort of obby and using much 'killing bricks' :PP |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 29 Apr 2012 07:22 AM |
You sound like you're trying to convince me of it. Save your efforts, for I already know.
My point is that it doesn't matter in a situation where this category of script would be needed. Especially if whomever is using it is still learning and happened to discover pcall. It's pointless to attempt to help them comprehend whether one method is more efficient by the smallest amount or not. I highly doubt anyone on ROBLOX who is making traditional games will **ever** need something of that knowledge - at least not of a priority. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 29 Apr 2012 07:23 AM |
"And especially if you're making some sort of obby and using much 'killing bricks' :PP"
And you're the one speaking of efficiency? If anyone was truly worried of that so, then they would find a better method - like controlling all of the similar-actions by one script, so new contexts do not have to load. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 29 Apr 2012 07:25 AM |
script.Parent.Touched:connect(function(a) if a:FindFirstChild("Humanoid") then a.Humanoid.Health = 0 end end) |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 Apr 2012 07:26 AM |
>like controlling all of the similar-actions by one script, so new contexts do not have to load.
I'd do that.. Is it really so wrong if I try to point up more efficient methods? |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 29 Apr 2012 07:28 AM |
> Is it really so wrong if I try to point up more efficient methods?
No, and I didn't type that it was. Do you think it bad of me to respond to what you said? |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 Apr 2012 07:31 AM |
>Really, too many people seem to care about efficiency in these situations where it does not make much of a difference - if any at all.
That just seems that you were trying to stop the whining about efficiency
|
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 29 Apr 2012 07:31 AM |
| jobro13's script is best i say! |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 29 Apr 2012 07:34 AM |
> That just seems that you were trying to stop the whining about efficiency
Actually, in typical psychology it would not seems so. I was actually implying that statement to you in general, which is why you obviously responded to it. I had no intention of referencing anyone else in the thread.
|
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 Apr 2012 07:36 AM |
| So it was just some random comment? dafuq |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
| |
|
MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 29 Apr 2012 08:20 AM |
script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") and hit.Parent:findFirstChild("Torso") then hit.Parent:findfirstChild("Humanoid").Health = 0 end end)
Put that into your brick.
- Cheers! |
|
|
| Report Abuse |
|
|