Photonics
|
  |
| Joined: 14 Feb 2010 |
| Total Posts: 26773 |
|
|
| 29 Nov 2013 08:48 PM |
So i had a friend explain to me some of the things in scripting First im going to try and analyze this lava brick ***NOTE: THE DASHES ARE MY QUESTIONS AS WELL***
function onTouched(part)-- Is part the name of the brick it is in? local h = part.Parent:findFirstChild("Humanoid")-- Findfirstchild? Parent? if h~=nil then -- My friend didnt explain the h~=nil then part h.Health = h.Health -100 wait(.1) end end
script.Parent.Touched:connect(onTouched)
The rest of this I understand, just those places where i included my notes in I don't understand, if someone could explain also what "nil" and "~" is used for? |
|
|
| Report Abuse |
|
|
Photonics
|
  |
| Joined: 14 Feb 2010 |
| Total Posts: 26773 |
|
| |
|
|
| 29 Nov 2013 09:00 PM |
| I'm pretty sure nil means clear, but I am not 100% sure. I don't know a lot about scripting sorry. For better answers, try the Scripting Helpers Forum. |
|
|
| Report Abuse |
|
|
Photonics
|
  |
| Joined: 14 Feb 2010 |
| Total Posts: 26773 |
|
|
| 29 Nov 2013 09:01 PM |
| Yeah, i reposted this there, i accidentally clicked this forum though |
|
|
| Report Abuse |
|
|