Hey dev fourm!
I’m making a system where it scrambles your messages and it is togglable but I want to make it only show the scrambled letters to those not in a certain group.
I’m doing this via Lua Chat Sytem
So basicly lets say anyone in the roblox group with the id of 5 has the ability to toggle scramble letters. But anyone not in the group with the id of 5 just sees the scrambled letter. While if your in the group you see the normal text. I have no idea how to do this.
Although this is what I have for the scrambled letters but it shows scramble for everyone and I dont want that.
local functionId = "editText"
local function doFilter(speaker, messageObject, channelName)
print(speaker)
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'}
local speaker = game:GetService("Players"):WaitForChild(speaker)
local DTValue = speaker:FindFirstChild("Backpack").DTValue
if DTValue.Value == true then
print("Player and DT True")
local length = string.len(messageObject.Message)
local str = ''
for i=1,length do
local randomLetter = letters[random:NextInteger(1,#letters)]
if random:NextNumber() > .5 then
randomLetter = string.upper(randomLetter)
end
str = str .. randomLetter
end
messageObject.Message = str
end
end
local function runChatModule(ChatService)
ChatService:RegisterFilterMessageFunction(functionId, doFilter)
end
return runChatModule
If you know how please reply!