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 » Scripters
Home Search
 

death block

Previous Thread :: Next Thread 
deer536 is not online. deer536
Joined: 13 Oct 2016
Total Posts: 39
17 May 2017 08:49 PM
function onTouched(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
--Basically this just checks to see if it is a real player touching this brick.
if (human ~= nil) then --If it is a real player, then DESTROY THEM!
human.Health = 0 --Your Health Is Now 0.
end
end

if (script.Parent ~= nil) and (script.Parent.className == "Part") then --Work if in a block
connection = script.Parent.Touched:connect(onTouched)
end
Report Abuse
MightyDantheman is not online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
17 May 2017 08:55 PM
Why not just do:


script.Parent.Touched:connect(function(x)
if x.Parent:FindFirstChild('Humanoid') then
x.Parent:BreakJoints()
end
end)


~MightyDantheman~
Report Abuse
LinkMe is not online. LinkMe
Joined: 30 Apr 2009
Total Posts: 512
17 May 2017 08:58 PM
Works fine for me.
Report Abuse
MightyDantheman is not online. MightyDantheman
Joined: 06 May 2011
Total Posts: 5108
17 May 2017 08:59 PM
It'll work, but you should try to be as efficient as possible. Of course, if one is just trying to get a prototype going, then efficiency can come later.


~MightyDantheman~
Report Abuse
deer536 is not online. deer536
Joined: 13 Oct 2016
Total Posts: 39
22 May 2017 08:45 PM
Ok
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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