I've currently got this for making a staff channel:
1 | local function Run(ChatService) |
2 |
3 | local staffChannel = ChatService:AddChannel( "Staff" ) |
4 |
5 | staffChannel.WelcomeMessage = "Welcome to the staff chat! Grammar is still required in this chat, only staff can see this channel." |
6 | staffChannel.Joinable = false |
7 |
8 |
9 | end |
I want to make it so only rank ...
from group ...
can see and enter/leave the chat. But I can't find much documentation
Here you go, you just have to change Group and Rank and then it should work.
01 | local Group = 0 |
02 | local Rank = 100 |
03 | local function Run(ChatService) |
04 |
05 | local staffChannel = ChatService:AddChannel( "Staff" ) |
06 |
07 | staffChannel.WelcomeMessage = "Welcome to the staff chat! Grammar is still required in this chat, only staff can see this channel." |
08 | staffChannel.Joinable = false |
09 |
10 | ChatService.SpeakerAdded:Connect( function (Speaker) |
11 | if Speaker.PlayerObj and Speaker.PlayerObj:GetRankInGroup(Group) > = Rank then |
12 | staffChannel:InternalAddSpeaker(Speaker) |
13 | end |
14 | end ) |
15 | end |