KasCode Player List! A Custom Minimalistic Player List!

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.

Hmmm, I tested it out in roblox studio, and there was no filter. I’ll see again.

Yeah, just try publishing it to roblox then test with someone.

Can you add some screenshots? ;

1 Like

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.

CC: @CyroStorms

Studio will not filter messages (Roblox doesn’t want to expose the filter API). You have to try it in a live game.

3 Likes

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?
image image image

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.

2 Likes

Update v1.4 on the 26th of January!

Fixed a major issue where the player label doesn’t work when a new player joins.

Roblox Studio by default, doesn’t have message filtering.

2 Likes

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!

Isn’t this the API for filtering?
https://developer.roblox.com/en-us/api-reference/function/TextService/FilterStringAsync

I think what they mean is Roblox doesn’t want to show the real source code for the filtering, so that people can’t find ways to bypass.

1 Like

No, that’s the engine API. I’m talking about the web API.

2 Likes

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!

1 Like

Update v1.5 on the 7th of March 2021!

Should now be compatible with the upcoming Display Names update by Roblox.
Also added Auto-setup!

Coming next (hopefully): Scrolling frame and maybe viewPort frames instead of player thumbnail!

1 Like

Update v1.6 on the 10th of March 2021!

Made the whole thing a scrolling frame! Maximum size on the screen: 150x300 px!
Also cleaned up some code for readability.

Coming next: viewPort frames and (maybe perhaps possibly no promises) customizable scaling! (my god, will these be hard to implement)

Could you possible add a toggle to the leaderboard? Allowing users to toggle turning the leaderboard off or on?

You can press tab to open/close it, if that’s what you’re thinking of.

Edit: there’s currently no way for mobile users to toggle it, I’m working on that!

Update v1.7 on the 3rd of April 2021!

Fixed some errors that didn’t actually effect the functionality but looked ugly in the output anyway. Also fixed some code that might have been using up performance, but should be fine now.
Also added icons for Premium and Star Creators!

1 Like