so i am making a custom chat similar to roblox chat and here is what happens
and i want it to set its size to its text bounds which is does NOT
here is the code for the server making
/
local re = game.ReplicatedStorage.SendMessage
local decoy = game.ReplicatedStorage.Decoy
local possiblecolors = {
"28, 139, 193",
"221, 212, 23",
"118, 10, 10",
"94, 42, 14",
}
local CSS,CSE,CE = "<stroke color = \"#000000\"><font color = \"rgb(",")\">","</font></stroke>"
re.OnServerEvent:Connect(function(plr,messsge)
local msg = game:GetService("Chat"):FilterStringForBroadcast(messsge,plr)
local c = decoy:Clone()
local chatcolor
if not plr:FindFirstChild("ChatColor") then
chatcolor = Instance.new("StringValue",plr)
chatcolor.Value = possiblecolors[math.random(1,#possiblecolors)]
chatcolor.Name = "ChatColor"
else
chatcolor = plr.ChatColor
end
c.Text = CSS..chatcolor.Value..CSE.."["..plr.DisplayName.."]"..CE.." "..msg
c.Parent = plr.PlayerGui.CustomChat.Front.Holder
c.Size = UDim2.new(1,0,0,c.TextBounds.Y)
end)
(yes i know that i have to replicate it for all clients i will soon)
