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: Killing Brick Script

Previous Thread :: Next Thread 
epic0gravity is not online. epic0gravity
Joined: 28 Feb 2012
Total Posts: 93
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 is not online. 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
epic0gravity is not online. epic0gravity
Joined: 28 Feb 2012
Total Posts: 93
29 Apr 2012 07:14 AM
that wont work
Report Abuse
su8 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
29 Apr 2012 07:31 AM
jobro13's script is best i say!
Report Abuse
MrNicNac is not online. 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 is not online. 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 is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Apr 2012 07:37 AM
No...it was-

Yes.
Report Abuse
MrMcAero is not online. 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
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