I'm currently learning functions. I don't know how I can make the message appear once only.
function PartTouch() m = Instance.new("Message", game.Workspace) m.Text = "Ouch! That hurts!" wait(5) m:Remove() end game.Workspace.Part.Touched:connect(PartTouch)
Try adding a debounce! (code below)
debounce = false function PartTouch() if debounce = false then debounce = true m = Instance.new("Message", game.Workspace) m.Text = "Ouch! That hurts!" wait(5) m:Remove() wait(3) debounce = false end end game.Workspace.Part.Touched:connect(PartTouch)