Hello, I am trying to use the TextService:FilterStringAsync() to filter words/string, However the 2nd parameter needs a player userID. Is there a way to filter text without having to use a player’s userID?
TextService:FilterStringAsync( word, userID )
For example, let’s say I made a random word generator that runs on the server-side. and I want to filter this random word. What am I gonna put for the Userid?
Heres my code:
local function filter(sentence)
local filteredTextResult
local filteredText
if sentence ~= "" then
local success, errorMessage = pcall(function()
filteredTextResult = TextService:FilterStringAsync(sentence, 110538855) -- this is my id, replace it with yours
filteredText = filteredTextResult:GetNonChatStringForBroadcastAsync()
end)
if success then
return(filteredText)
else
print(errorMessage)
end
end
end
This method currently throws if fromUserId is not online on the current server. We plan to support users who are offline or on a different server in the future.
No, currently it’s not possible. Why can’t you pass a userID though? Whose text do you need to filter?
Currently it’s not possible. And it seems that even if they add support for offline users in the future, you will end up needing to pass an ID in still.