brick = script.Parent
brick.Touched:connect(function(part)
print("test")
end)
Is an example of an anonymous function. How would I use a pre existing function instead of writing down the function inline?
brick = script.Parent
brick.Touched:connect(function(part)
print("test")
end)
Is an example of an anonymous function. How would I use a pre existing function instead of writing down the function inline?
local function MyNormalFunction(part)
print("test")
end
brick = script.Parent
brick.Touched:Connect(MyNormalFunction) -- :connect is deprecated, use :Connect instead.
easy-peesy
brick.Touced might not give you much, though.. :P
he meant Touched, duh
Thank you! In the Roblox wiki I never seen an example of an event that uses an already made function, they always use anon functions.
No problem.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Please accept my answer if it solves your question.