how do i create text channels visible to only some people?
lets say i have a normal chat channel, but i wanna create an admin chat channel where they type in their
commands so it doesnt annoy the normal chat.
i never looked into this and never needed it until now, please help with anything if possible.
First define all the variables, we will be using ChatService
local Players = game:GetService("Players")
local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
Now we will be needing to create the channel as well as locking it:
local ChannelName = "CoolPeople"
local Channel = ChatService:AddChannel(ChannelName)
Channel.Joinable = false
Channel.AutoJoin = false
After this we have to check if the next player can join the channel:
ChatService.SpeakerAdded:Connect(function(PlayerName)
local Player = Players:FindFirstChild(PlayerName)
if Player then -- put an extra and here like
-- Player:GetRoleInGroup(GroupId) == CertainRank or you can use
-- Player:IsFriendsWith(userId)
local Speaker = ChatService:GetSpeaker(PlayerName)
Speaker:JoinChannel(ChannelName)
end
end)
Does this still work? I tried this and people can still see each others chat from different channels
hmm weird it worked for me
so uhhhhhh idk
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.