I am trying to filter text for custom npc names.
But, TextService:FiltterStringAsync(text, fromPlayerId)
alway returns ‘Instance’, even if text
is a direct string. I’ve tried it in a script in Studio, Studio’s command bar and the console command bar in game, but it always returns ‘Instance’.
This is the code I used in the script:
wait(2)
local TextService = game:GetService("TextService")
local filteredText = ""
local success, errorMessage = pcall(function()
filteredTextResult = TextService:FilterStringAsync("lmao, discord is so epik", 287113233)
end)
if not success then
warn("Error filtering text:", text, ":", errorMessage)
-- Put code here to handle filter failure
end
print(filteredTextResult)
Which I sourced from Text Filtering | Roblox Creator Documentation and this is the code I used in the command bars:
print(game:GetService("TextService"):FilterStringAsync("lmao, discord is so epik", 287113233))
This is my first time posting on the devforum, so I’m sorry if I have done something wrong.