This also wraps any unstable services in pcalls, such as the friends service and the text filtering service (which doesn’t show the message if it fails)
Please report any bugs you found or features you would like! The player list is still new, and not everything is tested to the fullest extent!
I personally will not use this asset for that reason. Not only can the asset get banned, but the users may be banned as well. (Like what happened with the UTG model)
While, I haven’t actually put it into any game to test, I’ve looked at the code and there is a filter in the “SETUP INSTRUCTIONS” script. The function to look for is getFilteredMessage on line 51 of the model.It uses the :GetChatForUserAsync(). Unless the code is just broekn somewhere, try testing it in a published game with a friend/alt account because you might not be able to see the filtered message on client side if you are the sender. Again, I haven’t tested this myself, but I looked at the code.
My own custom chat system suffers from this issue.
Whilst I haven’t actually checked today, I’m 90% sure I have filtering implemented.
I suspect it is one of Studio’s quirks and will only work on a published game, not a local server.
The filter doesn’t work? I’ll send the source code for how it filters, I’m really surprised it doesn’t work… I’ll take it off-sale until I fix it!
Code with filtering
local replicatedStorage = game:GetService("ReplicatedStorage")
local textService = game:GetService("TextService")
local event
local function getTextObject(msg, playerId)
local textObject
local success, errorMessage = pcall(function()
textObject = textService:FilterStringAsync(msg, playerId)
end)
if success then
return textObject
else
warn("Error filtering pm FROM client-- "..msg.." {:} "..errorMessage)
end
return false
end
local function getFilteredMessage(txtObject, toPlayerId)
local filteredMsg
local success, errorMessage = pcall(function()
filteredMsg = txtObject:GetChatForUserAsync(toPlayerId)
end)
if success then
return filteredMsg
else
warn("Error filtering pm TO client-- "..errorMessage)
end
return "{!} Filtering Error {!}"
end
if replicatedStorage:FindFirstChild("kPlayerlistMessage") then
-- do nothing
else
local newEvent = Instance.new("RemoteEvent", replicatedStorage)
newEvent.Name = "kPlayerlistMessage"
event = newEvent
print("KasCode Playerlist Messaging event created")
end
event.OnServerEvent:Connect(function(player, targetPlayer, message)
local textObject = getTextObject(message, player.UserId)
local filteredMessage = getFilteredMessage(textObject, targetPlayer.UserId)
event:FireClient(targetPlayer, filteredMessage, player.Name)
end)
Referring to @AwakenedElemental’s issues with the messages filter, I’ve tested it to make sure it works. Here are the results after sending messages to myself (13+ account).
Original messages (in order from left to right): “Give me your credit card number now”, “Go to bux.gg for free robux!”, “Where do you live?”
I’ve also set up the code so that if the filter fails for some reason, it’s wrapped in a pcall, and should instead replace the message with “{!} Filtering Error {!}” in red text.
Please note that this has not been tested yet with <13 accounts, but in most cases if 13+ accounts get filtered text then <13 accounts will also be filtered.
Recently fixed a possible issue where the label doesn’t work when a new player joins. This fix is not live yet, and will be released when more testing is finished!
So uuhhhh Roblox recently made an update with Display Names which basically completely ruins my player list and sort of makes it unfunctional until I fix it, so expect an update which compensates for this questionable update!