Is this how it would be?
H = game.Workspace.Part
local debounce = true function onTouch(Part) if debounce and Button.Parent:FindFirstChild("Humanoid") and Button.Parent.Name == game.Players:findFirstChild(Button.Parent.Name) then debounce = false function onTouch(Part) Instance.new("Message", game.Workspace.Part) wait() H.Message.Text("You can pass.") end script.Parent.Touched:connect(onTouch)
To some extent, yes. But you need to remove the message after a small while, otherwise your game will get message spam. You may even want to add intervals between when the message can be activated or not.
--Example:
enabled = true H = game.Workspace.Part
function onTouch(Part) if enabled == true then enabled = false Instance.new("Message", game.Workspace.Part) wait() H.Message.Text("You can pass.") wait(1) H.Message:remove() enabled = true end end
script.Parent.Touched:connect(onTouch)
Wait so it is shown like this?
enabled = true H = game.Workspace.Part function onTouch(Part) if enabled == true then enabled = false Instance.new("Message", game.Workspace.Part) wait() H.Message.Text("You can pass.") wait(1) H.Message:remove() enabled = true end end script.Parent.Touched:connect(onTouch)
Pretty much, but I didn't even know H.Message.Text("You can pass.") works I though you could only say
H.Message.Text="You can pass."
Never forget the debounce!