Are these 2 ways of using Touch, work the same way or which one is better?
function onTouch(hit)
print"Hello!"
end
script.Parent.Touched:connect(onTouch)
script.Parent.Touched:connect(function (hit)
print"Hello!"
end)
Are these 2 ways of using Touch, work the same way or which one is better?
function onTouch(hit)
print"Hello!"
end
script.Parent.Touched:connect(onTouch)
script.Parent.Touched:connect(function (hit)
print"Hello!"
end)
I Prefer the bottom one it uses less lines of code.
Me too :D
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
Almost no difference. It's based on your preference. :3
I like the bottom one more
You can utilize this to take advantage of organizing your script.
Yes