How do you make a filtering system?
Asked by
7 years ago Edited 7 years ago
I tried to remake Roblox's old chat system. It works, but I know I need to make it filter so my game doesn't get banned.
For the filtering system, I wrote this:
02 | local TextService = game:GetService( 'TextService' ) |
04 | function game.ReplicatedStorage.FilterText.OnServerInvoke(toPlayer, fromPlayer, txt) |
05 | print (toPlayer, fromPlayer |
08 | local s = pcall ( function () |
09 | textObject = TextService:FilterStringAsync(txt, fromPlayer.UserId) |
12 | return textObject:GetChatForUserAsync(toPlayer.UserId) |
19 | function Chat:ApplyFilter(str, fromPlayer) |
25 | return game.ReplicatedStorage.FilterText:InvokeServer(fromPlayer, str) |
29 | local text = Chat:ApplyFilter(message, cPlayer) |
30 | mLabel.Text = nString .. text; |
I'm not sure if it's an error or not, but when I try to say something that usually gets filtered when I play Roblox, it doesn't. Please help me fix this!
EDIT: wait it worked all along nvm