Having trouble with creating custom playerJoined messages

  1. What do you want to achieve? I want to make it so that when the owner or developer of my game joins a chat message will appear.

  2. What is the issue? When I hit play, this happens.
    Screenshot 2024-07-21 at 9.54.02 PM
    Here’s my code.

textChatService:DisplaySystemMessage(`<b><stroke color=rgb(255,255,255) joins="miter" thickness="2" transparency="0"><font color=\"rgb(0, 157, 5)\">Lead Scripter </stroke>{player.Name} has joined the server.</b></font>`)
  1. What solutions have you tried so far? I tried rearranging some elements but that didn’t work.

If you see the issue in my code please respond! :smiley:

2 Likes

Do you need to tell the Chat service the origin of the message? For system originated messages I use:

TextChatService.TextChannels.RBXSystem:DisplaySystemMessage("Message, "RBXSystem")
1 Like

I think that you don’t need to escape the " strings since you’re using the ` symbol. So the string should be:

`<b><stroke color="rgb(255,255,255)" joins="miter" thickness="2" transparency="0"><font color="rgb(0, 157, 5)">Lead Scripter </stroke>{player.Name} has joined the server.</b></font>`

Or:

"<b><stroke color=\"rgb(255,255,255)\" joins=\"miter\" thickness=\"2\" transparency=\"0\"><font color=\"rgb(0, 157, 5)\">Lead Scripter </stroke>"..player.Name.." has joined the server.</b></font>"

Or:

'<b><stroke color="rgb(255,255,255)" joins="miter" thickness="2" transparency="0"><font color="rgb(0, 157, 5)">Lead Scripter </stroke>'..player.Name..' has joined the server.</b></font>'

Edit: @BadDad2004, I don’t believe you need to mention the message’s origin.

None of these worked, and I’m wondering if there’s a limit to how many modifiers you can have on text, because I also have this line of code for normal players:

textChatService:DisplaySystemMessage("<font color=\"rgb(50,255,0)\">"..player.Name.." has joined the server!</font>")

And this works just fine. Also, I have textChatService defined above, along with RBXGeneral and etc.

local textChatService = game:GetService("TextChatService").TextChannels.RBXGeneral

Ok so it turns out you can only have 1 modifier at a time for display system messages

No, it’s because you swapped the </b> and the </font> :sweat_smile:

Try this (this was taken from @NyrionDev’s post):

textChatService:DisplaySystemMessage(`<b><stroke color="rgb(255,255,255)" joins="miter" thickness="2" transparency="0"><font color="rgb(0, 157, 5)">Lead Scripter </stroke>{player.Name} has joined the server.</font></b>`)

That’s weird, it didn’t work, oh well.

Does this work?

textChatService:DisplaySystemMessage(`<b><stroke color="rgb(255,255,255)" joins="miter" thickness="2" transparency="0"><font color="rgb(0, 157, 5)">Lead Scripter </stroke>{player.Name} has joined the server.</font></stroke></b>`)

Hi, I think I found the solution as this worked for me. (edited from @Rescriptedd)

SystemChannel:DisplaySystemMessage(`<b><font color="rgb(0, 157, 5)">Lead Scripter <stroke color="rgb(255,255,255)" joins="miter" thickness="2" transparency="0">{player.Name}</stroke> has joined the server.</font></b>`)

Try it out if you want.

1 Like

@Pish85 This should work :sweat_smile:

textChatService:DisplaySystemMessage(`<b><stroke color="rgb(255,255,255)" joins="miter" thickness="2" transparency="0"><font color="rgb(0, 157, 5)">Lead Scripter</font></stroke> {player.Name} has joined the server.</b>`)

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