If you want to script start with this simple function :
"function onTouched(hit)"
then at the end :
"script.Parent.Touched:connect(onTouched)"
Which means that whatever the script's parent is will take effect on the script.
And because of the function, at the end before "script.Parent.Touched:connect(onTouched)" you want to type "end". The only problem is that the onTouched(hit) function will loop. So you want the "debounce = false" line ....
Here is a full script for a sample:
debounce = false
function onTouched(hit)
msg = Instance.new("Message")
msg.Parent = game.Workspace
msg Text = "You touched The brick!!"
wait(13)
msg:remove()
end
script.Parent.Touched:connect(onTouched)
|