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: Script for Killing Block

Previous Thread :: Next Thread 
MrCoolChicken is not online. MrCoolChicken
Joined: 04 Apr 2011
Total Posts: 10838
02 Feb 2012 07:17 PM
I need a block that can kill people when you touch it, like lava. I got everything placed out, but I don't know the script to kill someone when they touch the block. What do I do?
Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
02 Feb 2012 07:18 PM
function onTouched(p)
a = p.Parent.Humanoid
if a then
a.Health = 0
end
end
script.Parent.Touched:connect(onTouched)
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
02 Feb 2012 07:20 PM
We're not allowed to do requests until someone tries it themselves, but I'll give you this since it's very easily found from free models.

db = false
lava.Touched:connect(function(hit)
if not db then
db = true
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
wait()
db = false
end
end)

Edit lava for whatever part you want to kill on touch.
Report Abuse
RoboBlaster59 is not online. RoboBlaster59
Joined: 26 Feb 2011
Total Posts: 7116
02 Feb 2012 07:40 PM
OnTouch
Humanoid.MaxHealth=0
wait (3)
return true
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
02 Feb 2012 07:42 PM
One liner :D

script.Parent.Touched:connect(function(h) pcall(function() h.Parent:BreakJoints() end) end)
Report Abuse
soccaboy17 is not online. soccaboy17
Joined: 22 Sep 2009
Total Posts: 3161
02 Feb 2012 07:44 PM
Ogm one liner wins
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