Why do I continuously get an error when editing a chat script?

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
3 Likes

We need a little more information, such as what the error is, and what you’ve tried in order to solve the problem.

Try reading this: Guide to Making a Proper Scripting Support Topic - Resources / Community Tutorials - Developer Forum | Roblox

3 Likes

Well, I’m attempting to make the script group rank only, but 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
3 Likes

Fixed. I missued the ending statement. :+1:t4:

1 Like

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