|
| 28 Dec 2016 07:02 PM |
| I just want a string to be checked for anything bad so roblox doesn't cite my custom chat gui. Is there a simple way to do this so I don't have to write out every bad word in the dictionary? Thanks |
|
|
| Report Abuse |
|
|
Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 28 Dec 2016 07:05 PM |
| http://wiki.roblox.com/index.php?title=API:Class/Chat/FilterStringForBroadcast #### slices of pizza and counting |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 07:07 PM |
No, this is the one you want:
http://wiki.roblox.com/index.php?title=API:Class/Chat/FilterStringAsync
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 28 Dec 2016 07:08 PM |
Wouldn't FilterStringAsync be for chat specifically? Or would you make up some BS for the third argument?
585,062 slices of pizza and counting |
|
|
| Report Abuse |
|
|
Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 28 Dec 2016 07:09 PM |
nvm read the full thing now e.e
Use FilterStringAsync
585,102 slices of pizza and counting |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 07:09 PM |
He says in his post that this is for a chat gui.
|
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 07:10 PM |
| I don't understand something until I can see an example. Would anyone be able to show me how I actually use this function? |
|
|
| Report Abuse |
|
|
Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 28 Dec 2016 07:10 PM |
I seriously need to rethink my life.
585,102 slices of pizza and counting |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 07:11 PM |
http://wiki.roblox.com/index.php?title=Custom_chat_GUI
|
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 07:12 PM |
@Dillusions
I used that tutorial and still managed to drop and f-bomb in the chat |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 07:12 PM |
local chatService = game:GetService("ChatService")
for i,v in pairs(game.Players:GetPlayers()) do local filteredMessage = chatService:FilterStringAsync(originalMessage, fromPlayer, v) sendMessageToPlayer(v, filteredMessage) end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Dec 2016 07:17 PM |
@foreverpower
studio underlined "ChatService" |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 07:18 PM |
@Fresh
FilterAsync doesn't work in studio
that chat tutorial doesn't filter the string for yourself, only for others
|
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 07:19 PM |
@Dillusions
Oh, that makes sense. Thanks. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 28 Dec 2016 08:14 PM |
here is the most basic example of filtering
local filtered = {'noob','lame','lol'}
local msg = 'hi noobs you are all lame people lol'
local Filter = function(msg) local s = msg for i,v in next, filtered do for m in msg:gmatch(v) do s = s:gsub(m,string.rep('#',#m)) end end return s end
print(Filter(msg))
>>hi ####s you are all #### people ###
|
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 08:16 PM |
^
Not really what he was asking for.
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 28 Dec 2016 08:18 PM |
yes i dont care what he was asking for because filterstring is awful.
|
|
|
| Report Abuse |
|
|
|
| 28 Dec 2016 08:22 PM |
It is, but Roblox will potentially ban games for not using it.
|
|
|
| Report Abuse |
|
|