#Filtering Text from BillboardGUI

1 messages · Page 1 of 1 (latest)

vernal adder
#

How do you use the TextService:FilterStringAsync? I was originally filtering through a LocalScript but thats deprecated now and need a fix.

sick wave
#

you have to filter through the server if its shown to everyone

#

if its just something only that player can see you dont have to filter it

#

this is how i do it

function filterString(playerUserId : number, str : string)
    if str == nil then return false end
    if not str then return false end
    if typeof(str) ~= "string" then return false end

    local filtered = ""
    local textFilteringResult

    local success, errormsg = pcall(function()
        textFilteringResult = TextService:FilterStringAsync(str,playerUserId)
    end)
    if not success then warn(errormsg) return end

    local suc, ermsg = pcall(function()
        filtered = textFilteringResult:GetNonChatStringForBroadcastAsync()
    end)

    if not suc then warn(ermsg) return end
    return filtered
end
vernal adder
sick wave
#

straight from the docs