Hello everyone! I want to make a PRIVATE STAFF CHANNEL only for a certain rank. I tried a lot of scripts but none worked.
Here is one that I tried:
local Players = game:GetService("Players") --// Needed for later
local ServerScriptService = game:GetService("ServerScriptService")
local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local GroupId = 9544070 --// Put your's here
local CertainRank = "Owner"
local ChannelName = "Staff"
local chan = ChatService:AddChannel("hi")
chan.Joinable = true
chan.AutoJoin = true
--// There's more customisation too
ChatService.SpeakerAdded:Connect(function(PlayerName)
local Player = Players:FindFirstChild(PlayerName)
if Player and Player:GetRoleInGroup(GroupId) == CertainRank then
local Speaker = ChatService:GetSpeaker(PlayerName)
Speaker:JoinChannel(ChannelName)
end
end)
Can someone help me? :C Thank you.

1 comment
The script is in ServerScriptService