1 | brick = script.Parent |
2 | brick.Touched:connect( function (part) |
3 | print ( "test" ) |
4 | end ) |
Is an example of an anonymous function. How would I use a pre existing function instead of writing down the function inline?
1 | local function MyNormalFunction(part) |
2 | print ( "test" ) |
3 | end |
4 | brick = script.Parent |
5 | brick.Touched:Connect(MyNormalFunction) -- :connect is deprecated, use :Connect instead. |
easy-peesy