:Chat() function won't work when colour is white

I have been trying to make an NPC chat using the :Chat() function but whenever I change the colour to white, it doesn’t show up. I have tried this with the red and other colours and they all work fine but when it is white chat it doesn’t work.

the code for this:

local ChatService = game:GetService("Chat")

local part = game.Workspace.Part
wait(6)


game:GetService("Chat"):Chat(part, "we do a little trolling", "White")
print("did")
1 Like

When testing:

  1. Actually play test, don’t click run
  2. Make sure this is in a server script
  3. Have you tried using a while loop?
1 Like
  1. I have been play testing it
  2. It is a server script
    and for the while loop i am not sure how you would set it up so i just did
while wait() do
	game:GetService("Chat"):Chat(part, "we do a little trolling", "White")
	print("did")
end

and it also didn’t work

1 Like

The third argument of the Chat function is enum (integer), not a string.
Try doing game:GetService("Chat"):Chat(part, "we do a little trolling", Enum.ChatColor.White)

3 Likes

Strange, it works for me perfectly (with or without a while loop).

1 Like

I use strings for the 3rd argument and it works fine

1 Like

It works sort of but only sometimes for some reason.

add a wait which lasts for a few seconds

i have had a wait that lasts for 6 seconds

inside the while loop I meant since it’s probably executing really fast and causing possible issues

yeah i took the while loop out because the part was just flooding with messages so there is onlly one message being said

Just wanted to point out you defined chat service above but you redefine it again lol

oh yeah lol thats because i took the code sample off of the roblox page for the chat function and then found another one when i tried to look for the fix for the thing that is happening to me

1 Like

well i figured it out it turns out it was because i was just running it at runtime using a wait which for some reason didn’t work but when i changed it to fire the chat message when i click the part instead it works perfectly fine so idk why it wasn’t working

1 Like