Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with messages?

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)

3 answers

✓ Accepted answer

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)

1 comment

0

Yes, it is.

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.