local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
local dev_ids = {1, 2, 3}
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local props = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
if player then
if table.find(dev_ids,player.UserId) then
props.PrefixText = "<font color='#eeff00'>[🛠️Developer]</font> " .. message.PrefixText
end
end
end
return props
end
based on the VIP tag example from this post
And I’ve added print statements to print after OnIncomingMessage is fired but it’s never printing that despite messages being sent. my ChatVersion is set to TextChatService. No clue what’s going on
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
local dev_ids = {1, 2, 3} -- Add all developer IDs to this array
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
print("test")
local props = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
if player then
if table.find(dev_ids,player.UserId) then
props.PrefixText = "<font color='#eeff00'>[🛠️Developer]</font> " .. message.PrefixText
end
end
end
return props
end
I added print statements after each of the if statements, and they print all the way to the table.find if statement, where it stops. Mine is also located in StarterPlayerScripts.
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
local dev_ids = {1, 2, 3}
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
print("Message found")
local props = Instance.new("TextChatMessageProperties")
if message.TextSource then
print("message.TextSource found")
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
if player then
print("Player found")
if table.find(dev_ids,player.UserId) then
print("Table found")
props.Text = "<font color='#eeff00'>[🛠️Developer]</font> " .. message.PrefixText
end
end
end
return props
end
You need to replace 1, 2, 3 in the dev_ids to be the actual player.UserId of the player. After I did that, it worked perfectly. Here is my updated script (hopefully this works for you):
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
local dev_ids = {1206175753} -- replace this number with your players UserId
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
print("Message found")
local props = Instance.new("TextChatMessageProperties")
if message.TextSource then
print("message.TextSource found")
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
if player then
print("Player found")
print(player.UserId)
if table.find(dev_ids, player.UserId) then
print("Table found")
props.Text = "<font color='#eeff00'>[🛠️Developer]</font> " .. message.PrefixText
end
end
end
return props
end