Pages

Friday, June 10, 2011

Scripting Help 6/10/11

Dear BCG,
in the following:

function onTouch(part)

What is the '(part)'?
-dudelonutoipitepidermislolwhyisthereskininthere

Dear dudelonutoipitepidermislolwhyisthereskininthere,
The (part) indicates what to call the touched part as. For example,

function Touch(part)
part:remove()
end
script.Parent.Touched:connect(Touch)

So brick 1 falls on top of brick 2. Brick 2 has that script in it. When brick 1 hits brick 2, brick 1 will be removed. So part allows the script to recognize the object that touched the brick the script is in.

No comments:

Post a Comment

Write your comment here... OR Flingi will eat you