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
 

I'm a beginner, please help<3

Previous Thread :: Next Thread 
w1ld3rn3sg0d is not online. w1ld3rn3sg0d
Joined: 10 Oct 2009
Total Posts: 21
08 Apr 2012 06:39 PM
I know this script works:

local lava = script.Parent

function onTouch(Part)

local player = Part.Parent:findFirstChild("Humanoid")

if (player ~= nil) then
player.Health = 0

end
end

lava.Touched:connect(onTouch)

But I was wondering what the "Part" In "local player = Part.Parent:findFirstChild("Humanoid")" Is refering to, I'm trying to understand scripting a bit more, that's why I'm wondering.
Report Abuse
XGojiraX is not online. XGojiraX
Joined: 07 Dec 2010
Total Posts: 10
08 Apr 2012 06:47 PM
When the function 'OnTouch' is called, it sets the variable 'Part' to what ever is touched. Part.Parent:findFirstChild("Humanoid") is looking for a Humanoid in the same directory as the 'Part'.
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
08 Apr 2012 06:55 PM
script.Parent.Touched:connect(function(part)
if part.Parent:findFirstChild("Humanoid") then
part.Parent:breakJoints()
end
end)
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
08 Apr 2012 06:55 PM
Part is the object that hits the lava. The parent of a leg is a character, then it finds a Humanoid.
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