Hi, so i'm trying to make a custom chat gui feature and so I need to filter my chat. But when I try to do it I get this error: Unable to cast value to Object.
Filter Line:
local filteredText = game.Chat:FilterStringForBroadcast(Message, Speaker)
Where Message is coming from:
ChatEvent.OnClientEvent:connect(function(Request, Message, Speaker) Request = Request:lower() if Request == "chat" then CreateMessage(Message, Speaker) end end)
Thanks :)
There you go MinePlayersPE1
local function CreateMessage(Message, Speaker) local filteredText = game.Chat:FilterStringForBroadcast(Message, Speaker) local Label = Instance.new("TextLabel") Label.BackgroundTransparency = 1 Label.TextXAlignment = "Left" Label.TextColor3 = Color3.new(1,1,1) Label.Font = "ArialBold" Label.FontSize = "Size18" Label.Size = UDim2.new(1,0,0,25) Label.Position = UDim2.new(0,0,1,-25) if game.CreatorId == Speaker.userId then Label.Text = "[OWNER]"..tostring(Speaker)..": "..filteredText Label.Label.TextColor3 = Color3.new(255/255, 147/255, 23/255) else Label.Text = tostring(Speaker)..": "..filteredText end PushMessages(Label.Size.Y.Offset) Chats[#Chats+1] = Label Label.Parent = ChatFrame end