Im trying to build a brick that if you touch it will send a message. It is not working here is my script. What do you i need to fix in the script?
message = Instance.New("Message")
message.Text = messgeText
messageText = "Hello"
function onTouched(hit)
local h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
message.Parent = Game.Workspace.Part
wait(5)
end
end
script.Parent.Touched:connect(onTouched)
OnTouch(Game.Workspace.Part)

1 comment
Mr1vgy it works! thank you so much