I'm very confused on how to use FilterStringAsync
from a Service called, TextService
.
Here is the script, NOTE: it's in a server script!
--note; TS = game:GetService("TextService") local other = string.sub(msg,7):upper() local filter = TS:FilterStringAsync(other,player.UserId) wait(0.2) MessageEvent:FireAllClients("[WARNING]: "..filter,BrickColor.new("Crimson").Color)
For the error, it states that Line 6
has the error. The error is; attempted to index local 'filter' (a userdata value)
, any help?
the Chat service is the only service with filter methods, it can be used for any text not only chat messages.
Chat = game:GetService("Chat") local other = msg:upper():sub(7) local filtered = Chat:FilterStringForBroadcast(other,player) MessageEvent:FireAllClients("[WARNING]: " .. filter,BrickColor.new("Crimson").Color)