hi, im making a game with my friend, and we’re running into this issue. the space between the prefixtext and the normal text isnt there (when the tags gets added). image below>>
code:
local TextChatService = game:GetService("TextChatService")
TextChatService.OnIncomingMessage = function(Message)
local Properties = Instance.new("TextChatMessageProperties")
if Message.TextSource ~= nil then
local player = game:GetService("Players"):GetPlayerByUserId(Message.TextSource.UserId)
local hasVerifiedBadge = false
local Text = ""
local Tags, lbtag = game.ReplicatedStorage.Events.GetPlayerTags:InvokeServer(Message.TextSource.UserId)
local lbtagfr = ""
if lbtag then
lbtagfr = "<font size='18'><font face='GothamBold'><font color='#"..lbtag.TagColor:ToHex().."'>["..lbtag.TagText.."] </font></font></font>"
end
if Tags then
for i, v in pairs(Tags) do
if v ~= nil then
Text = Text.. "<font size='18'><font face='GothamBold'><font color='#"..v.TagColor:ToHex().."'>["..v.TagText.."] </font></font></font>"
end
end
end
Text = Text..lbtagfr
if player then
hasVerifiedBadge = table.find(require(game.ReplicatedStorage.Admin), player.UserId)
else
return Instance.new("TextChatMessageProperties")
end
if hasVerifiedBadge then
Text = Text..player.DisplayName.."\238\128\128: "
else
Text = Text..player.DisplayName..": "
end
Properties.PrefixText = Text
end
return Properties
end
edit//
looks like it gets pushed in further as each tag gets added
Hey, I think I’ve found your issue, but I am not entirely sure as I didn’t test it.
TextChatService.OnIncomingMessage = function(Message)
local Properties = Instance.new("TextChatMessageProperties")
if Message.TextSource ~= nil then
local player = game:GetService("Players"):GetPlayerByUserId(Message.TextSource.UserId)
local hasVerifiedBadge = false
local Text = ""
local Tags, lbtag = game.ReplicatedStorage.Events.GetPlayerTags:InvokeServer(Message.TextSource.UserId)
local lbtagfr = ""
if lbtag then
lbtagfr = "<font size='18'><font face='GothamBold'><font color='#"..lbtag.TagColor:ToHex().."'>["..lbtag.TagText.."] </font></font></font>"
end
if Tags then
for i, v in pairs(Tags) do
if v ~= nil then
Text = Text .. "<font size='18'><font face='GothamBold'><font color='#"..v.TagColor:ToHex().."'>["..v.TagText.."] </font></font></font>"
end
end
end
Text = Text .. lbtagfr
if player then
hasVerifiedBadge = table.find(require(game.ReplicatedStorage.Admin), player.UserId)
else
return Instance.new("TextChatMessageProperties")
end
if hasVerifiedBadge then
Text = Text .. player.DisplayName .. "\238\128\128: "
else
Text = Text .. player.DisplayName .. ": "
end
Properties.PrefixText = Text
end
return Properties
end
I had a similar issue before, it’s because of the font you use. I fix the issue by adding an additional space since the size of the text font makes the spacing almost unnoticeable with only 1 space.
local TextChatService = game:GetService("TextChatService")
TextChatService.OnIncomingMessage = function(Message)
local Properties = Instance.new("TextChatMessageProperties")
if Message.TextSource ~= nil then
local player = game:GetService("Players"):GetPlayerByUserId(Message.TextSource.UserId)
local hasVerifiedBadge = false
local Text = ""
local Tags, lbtag = game.ReplicatedStorage.Events.GetPlayerTags:InvokeServer(Message.TextSource.UserId)
local lbtagfr = ""
if lbtag then
lbtagfr = "<font size='18'><font face='GothamBold'><font color='#"..lbtag.TagColor:ToHex().."'>["..lbtag.TagText.."] </font></font></font>"
end
if Tags then
for i, v in pairs(Tags) do
if v ~= nil then
Text = Text.. "<font size='18'><font face='GothamBold'><font color='#"..v.TagColor:ToHex().."'>["..v.TagText.."] </font></font></font>"
end
end
end
Text = Text..lbtagfr
if player then
hasVerifiedBadge = table.find(require(game.ReplicatedStorage.Admin), player.UserId)
else
return Instance.new("TextChatMessageProperties")
end
if hasVerifiedBadge then
Text = Text..player.DisplayName.."\238\128\128: "
else
Text = Text..player.DisplayName..": "
end
Properties.PrefixText = Text
end
return Properties
end