Scrambled Chat Option

Hey Developers!

I wanna figure out how to make it where you can toggle an option and only certain players can see that chat and others see nothing or just scrambled text (random letters like “ahejcjehfhfjwurj” instead of the actual message”) I think this is possible due to I think I saw it before but I’m not sure how to.

If you know how to please leave a reply!

Three words, custom chat system.

Or make some chat event hooks (not sure about this one)

I have never made a custom chat system how does one do this with also bubble chat? I would also like to use the default message looks due to they look nice to me.

hello this is possible to do and i think you can do this by using a get players function and detect all players currently in the server and set a random term for how many of them can see it, you can use something called “string” which is useful for replacing words in a chat sentence, i’m not very familliar with string so take your time learning it and see some stuff that’ll fit what you need to do

(it’s extremely complex)

1 Like

Thanks! I will reply to this if I need anymore help.

Hey! I got this to semi work. But It dosnt change my actual message, this is it. Hope you can help.

-- DT Chated

local random = Random.new()
local letters = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}

function getRandomLetter()
	return letters[random:NextInteger(1,#letters)]
end

function getRandomString(length, includeCapitals)
	local length = length or 10
	local str = ''
	for i=1,length do
		local randomLetter = getRandomLetter()
		if includeCapitals and random:NextNumber() > .5 then
			randomLetter = string.upper(randomLetter)
		end
		str = str .. randomLetter
	end
	return str
end

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		if not player:IsInGroup(12238766) then print("Return") return end -- Scramble Wl
		wait(5)
		local DTValue = player.Backpack.DTValue
		player.Chatted:Connect(function(msg)
			print("Message")
			if DTValue.Value == true then
				print("Player and DT True")
				for i, op in ipairs(Players:GetChildren()) do
					if not op:IsInGroup(12238766) then -- Can add more or not player:userid(id) or IsInGroup etc for peeps to see the chat
						local scram = getRandomString(string.len(msg), true)
						msg = scram
						print(scram)
					end
				end
			end
		end)
	end)
end)

hmm i don’t know what else prevents the message from being encoded but can you try looking in the output? or the problem is that you might not be in the group