Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
|
| 24 Sep 2017 09:09 AM |
this is the server script which is called by the client, it only returns the same text, not filtered.
local Chat = game:GetService("Chat") local ReplicatedStorage = game:GetService("ReplicatedStorage")
game.ReplicatedStorage.filter_text.OnServerInvoke = function(player, text) local success, message = pcall(function() filteredText = game.Chat:FilterStringForBroadcast(text, player) end) if not success then text = "" end print(filteredText) return filteredText end
|
|
|
| Report Abuse |
|
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
| |
|
|
| 24 Sep 2017 09:59 AM |
Are you testing this online?
|
|
|
| Report Abuse |
|
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
|
| 24 Sep 2017 10:04 AM |
i am testing this on my game.
it just returns the same text as was input.
text is just a normal string that a player inputs into a gui.
I enter swearing on play mode on studio and it just returns the same thing
|
|
|
| Report Abuse |
|
|
|
| 24 Sep 2017 10:23 AM |
IIRC, it only works online. I'm probably wrong, but you should consider testing online. Also, you should ditch the pcall because if there's an error there, you want to know. Pcall is only for things that have a random chance of erroring with errors that can't be fixed and can be ignored.
|
|
|
| Report Abuse |
|
|
200Ethan
|
  |
| Joined: 01 Apr 2013 |
| Total Posts: 302 |
|
|
| 24 Sep 2017 10:27 AM |
| It doesn't look like message is being called... But if it wasn't being called, then filteredText would be unknown, right? This is weird, because everything looks like it should work... I'm not the best at scripting, so I have a question: is message being called instantly after being defined or something? |
|
|
| Report Abuse |
|
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
|
| 24 Sep 2017 01:25 PM |
here is where the text is used in the client gui:
-- filter text that was sent new_text = game.ReplicatedStorage.filter_text:InvokeServer(script.Parent.Parent.Input.Text) print(new_text) it just prints the unfiltered text
|
|
|
| Report Abuse |
|
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
| |
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
| |
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
| |
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
| |
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
| |
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
| |
|
|
| 24 Sep 2017 03:14 PM |
| stop bumping this, after 3 bumps just stop and wait for a response. |
|
|
| Report Abuse |
|
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
| |
|
Iegoadz
|
  |
| Joined: 13 Sep 2015 |
| Total Posts: 4189 |
|
|
| 24 Sep 2017 04:55 PM |
ok yea does just turn out that it doesnt work in play mode, but in normal online mode it does
ty
|
|
|
| Report Abuse |
|
|