A function is a block of code that we can ask to happen at some particular moment (for example, upon a collision).
Functions look like this:
function someFunctionName(someParameter)
end
An event , like Touched (for when a part touches any other part) calls a particular function that we connect to it.
In general, that looks like this:
someEvent:connect(someFunctionName)
For a Touched event, we could have a script that looks like this:
function collide(partColliding)
if partColliding == brick2 then
print("They hit")
end
end
brick1.Touched:connect(collide)
2 comments
I removed mine, since yours seemed like the better answer.
Didn't work. Nothing in the output.