- I want to filter text recieved from remote event
Heres my script :
script.Parent.change.OnServerEvent:Connect(function(plr,val)
if type(val) == "string" and #val < 210 and deb == false then
deb = true
local newval = nil
local s,e = pcall(function()
newval = TextService:FilterStringAsync(val,plr.UserId,Enum.TextFilterContext.PublicChat):GetChatForUserAsync(plr.UserId)
end)
if not s then warn(e) else
script.Parent.Part.SurfaceGui.TextLabel.Text = newval
print(newval)
end
wait(3)
deb = false
end
end)
So i try to filter the recieved text, but for some reason it doesnt filter and this is what could be printed: