I have created a script that when placed in StarterPlayerScripts applies a verification badge to a player in chat. So far, I was able to make that happen, but ran into a few errors when trying to make it group rank only. I am stuck, and am wondering if someone could help me discover and solve this issue?
Here is the script:
local TextChatService = game:GetService("TextChatService")
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local properties = Instance.new ("TextChatMessageProperties")
if message.TextSource then
local playermessaged = game:GetService("Players"):GetPlayerByUserId(message.TextSource.UserId)
if playermessaged:GetRankInGroup(32575367) >= 2 then
properties.PrefixText = string.gsub(message.PrefixText, ":$", utf8.char(0xE000)..":")
end
return properties
end
While attempting to make the script group rank only, I continue to receive an error near the end of the script.
I would like to know if I can solve this error, or if some could help me rewrite it.
Original script:
local TextChatService = game:GetService("TextChatService")
TextChatService.OnIncomingMessage = function(chatMessage: TextChatMessage)
local txtProperties = Instance.new("TextChatMessageProperties")
if chatMessage.Text then
txtProperties.PrefixText = string.gsub(chatMessage.PrefixText, ":$", utf8.char(0xE000)..":")
end
return txtProperties
end