Help with FilterStringAsync()

  1. 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:
image

Roblox doesn’t filter if you’re testing in studio, it should work when you test it in an actual game.

2 Likes

Thank You! ( Limit symbols) s ssss

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