Answered by
u_g 90
10 years ago
It expands the head, if there's a BodyVelocity inside of it.
02 | function onDamage(Part) |
04 | if Part:findFirstChild( "Humanoid" ) = = nil and Part:findFirstChild( "BodyVelocity" ) ~ = nil then |
08 | if Part:findFirstChild( "Mesh" ) ~ = nil then |
10 | z = Part:findFirstChild( "Mesh" ) |
14 | z.Scale = z.Scale + Vector 3. new( 1 , 1 , 1 ) |
Line 1: Function, named onDamage.
Line 2: If the Part (the part that is touched) does not have a child named "Humanoid" inside of it
and there's a BodyVelocity inside of it, then...
Line 3: Anchor the part, prevent it from moving
Line 4: If there's a Mesh inside of the Part (or a an object named part) then...
Line 5: Makes a new variable called "z", a shortcut to the mesh inside the part.
Line 6: "for i = 1, 5 do" tells us that the code is going to be repeated 5 times.
Line 7: (This is going to be repeated 5 times) the mesh's size is going to become 2x larger
Line 8: "wait()" means that the repeat is going to be put on hold for the time in the brackets. You can think of it as a "pause" before the next code is executed (in this case, another repeat, via the "for" loop).
Satisfied?