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!