Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What can I change to make it work?

Asked by 10 years ago
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)

1 answer

Log in to vote
1
Answered by 10 years ago

On line 2, you did an error, you forgot to capitalize the 'M' in 'Message';

local message = Instance.new("Message",game.Workspace)
Ad

Answer this question