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 » Building Helpers
Home Search
 

Re: How can I make a killing brick?

Previous Thread :: Next Thread 
charezard is not online. charezard
Joined: 29 Nov 2009
Total Posts: 990
07 Aug 2011 11:04 PM
I used a lava model but I wanted to know how I can make my own lava. But I kinda have a problem... How am I supposed to make it kill?! I hope it doesn't include scripts. >_<
Report Abuse
tummey2 is not online. tummey2
Joined: 04 Feb 2009
Total Posts: 1802
07 Aug 2011 11:15 PM
It does, but it's simple

function Touch(hit) -- The function
if hit.Parent:findFirstChild("Humanoid") then--Checking if hit has a Humanoid
hit.Parent:BreakJoints()-- object/model passed test, break joints
end
end -- endings...
script.Parent.Touched:connect(Touch) -- telling the script to connect when
--touched with the brick
Report Abuse
charezard is not online. charezard
Joined: 29 Nov 2009
Total Posts: 990
07 Aug 2011 11:25 PM
So what this script does is tell the function that when someone were to hit this, the Parent would find the Humanoid and break the joints to kill the player?

Also, how do I add this script to the brick?
Do I select the brick then Insert > Object... > Script and then paste that into the script? Sorry but I've never done anything that needed scripts. @_@ And when I did that and touched the brick, nothing happened. D:
Report Abuse
tummey2 is not online. tummey2
Joined: 04 Feb 2009
Total Posts: 1802
07 Aug 2011 11:41 PM
function Touch(hit)
if hit.Parent:findFirstChild("Humanoid") then
hit.Parent:BreakJoints()
end
end
script.Parent.Touched:connect(Touch)

A function is a quick way of saying alot of code. (This isn't alot but functions are important when using a connect method)

Inside the function i wrote if hit.Parent:findFirstChild("Humanoid") then
if means, if an even ocurs. Then just means what happens if that even occurs
e.g. if cows fall from the sky then i'll give you a dollar
hit.Parent.findFirstChild("Humanoid") is simply saying the thing touching the brick has a Humanoid in it. So if thing touching brick has a Humanoid thing in it then...

hit.Parent:BreakJoint() is simply saying break the joints

So in english we coluld translate this to

if thing touching brick has a Humanoid thing in it then
break that things joints

Then we tell the script to use that function when the brick it is inside of is touched. e.g. script.Parent.Touched:connect(Touch)

Regardless, Insert> Object> Script.
Paste script above into script. Place script in the killing brick or bricks
Report Abuse
tummey2 is not online. tummey2
Joined: 04 Feb 2009
Total Posts: 1802
07 Aug 2011 11:42 PM
Btw make sure when you add your script the game is paused. Then click play to test it.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Building 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