function onTouch(part) --function
local message = Instance.new('message',game.Workspace) --creates new message
message.Text = "You touched a brick!" -- What the message says
wait(2) -- how long before message is destroyed
message:Destroy()--Destroys the message
end
script.Parent.Touched:connect(onTouch)
(puts a message on the screen)
