Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

onTouch Question Help?

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)

4 comments

2

Almost no difference. It's based on your preference. :3

0

I like the bottom one more

0

You can utilize this to take advantage of organizing your script.

0

Yes

1 answer

✓ Accepted answer

I Prefer the bottom one it uses less lines of code.

1 comment

0

Me too :D

This discussion is preserved as it was. New answers, comments, and votes are closed.