Make a chat message when someone finishes the obby

i want to make a message in the chat when someone finishes the obby but i dont know how to go about doing this can someone help?

12 Likes

Basically when the player gets to the end (I’m assuming there will be a part at the end), you would (for LegacyChat) use

StarterGui:SetCore(“ChatMakeSystemMessage”, {
Text = “THIS PERSON FINISHED THE GAME”
})
7 Likes

Hello.

You could utilize the SetCore method under StarterGui to accomplish this however this would only replicate the effect on the client. You could use the updated chat services’ DisplaySystemMessage method.

Here’s an example of how you could do it:

local message = "<font color=\"rgb(255, 0, 0)\">Hello world!</font>"
game.TextChatService.TextChannels.RBXSystem:DisplaySystemMessage(message)

I’d recommend looking into TextChatService.

6 Likes

how would i use that to make the message when a part is touched? how would i make the message only happen once when you touch it? im assuming i could just use script:Destroy() or script.Disabled = true but is there a better way?

local Part = script.Parent

Part.Touched:Connect(function()

-- ???

is there a better way to do this besides touching a part?

5 Likes

If you only want this to run once, you’d use Once instead of Connect like this:

Part.Touched:Once(function()

end)

Also keep in mind that all new games DON’T use LegacyChat by default so if yours doesn’t, refer to @Ksuose’s post (and mark theirs as the solution).

6 Likes

You could use Region3 and then trigger it from there. You could also check the distance between the Player’s HumanoidRootPart and a part in the ending area / winners area and if they are close then enough then… yeah.

4 Likes

so like this?

Part.Touched:Once(function()

StarterGui:SetCore(“ChatMakeSystemMessage”, {
Text = “THIS PERSON FINISHED THE GAME”
})

end
4 Likes

Yeah but check if you have the old chat box (LegacyChat) or the new one (TextChatService). If you have TextChatService you’ll have to refer to @Ksuose.

4 Likes

so if you have LegacyChat you would use the one I mentioned before but if you have the new chat you would use something like this (correct me if i do something wrong)

Part.Touched:Once(function()

local message = "<font color=\"rgb(255, 0, 0)\">Hello world!</font>"
game.TextChatService.TextChannels.RBXSystem:DisplaySystemMessage(message)

end
1 Like

There’s a way to see this via studio. Under TextChatService in ROBLOX studio, there’s a ChatVersion property. If this is set to TextChatService it means you’re using the new ROBLOX chat service.
image

I hope this helps!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.