|
| 06 Jan 2017 05:33 PM |
So that only members of a specific group could join the game?
I need one for the AC-SURGE war.
|
|
|
| Report Abuse |
|
|
Insurrect
|
  |
| Joined: 04 Oct 2013 |
| Total Posts: 22734 |
|
| |
|
|
| 06 Jan 2017 05:37 PM |
local Players = game:GetService("Players") local SURGEid = --insert the SURGE group ID here local ACid = --insert the AC group ID here
PlayersAllowed = {}
Players.PlayerAdded:Connect(function(Player) PlayersAllowed[#PlayersAllowed + 1] = Player.Name if Player:GetRankInGroup == SURGEid or ACid then Player:Destroy() end) |
|
|
| Report Abuse |
|
|
TENSHl
|
  |
| Joined: 16 May 2014 |
| Total Posts: 5520 |
|
|
| 06 Jan 2017 05:39 PM |
Make sure you include Resade and Could 9 in the list of groups that can join.
|
|
|
| Report Abuse |
|
|
|
| 06 Jan 2017 05:41 PM |
| oh wait my code isn't right hold on, lemme think |
|
|
| Report Abuse |
|
|
TENSHl
|
  |
| Joined: 16 May 2014 |
| Total Posts: 5520 |
|
|
| 06 Jan 2017 05:42 PM |
Oh yeah also FoL but you don't have to allow main RAT.
|
|
|
| Report Abuse |
|
|
|
| 06 Jan 2017 05:44 PM |
| https://www.roblox.com/develop/library?CatalogContext=2&Category=6&Keyword=group%20whitelist |
|
|
| Report Abuse |
|
|
55Altair
|
  |
| Joined: 18 Oct 2008 |
| Total Posts: 6272 |
|
|
| 06 Jan 2017 05:49 PM |
game.Players.PlayerAdded:connect(function(p) repeat wait() until p ~= nil -- wait until they load if not p:IsInGroup(AC group ID) or not p:IsInGroup(SURGE group ID) then -- if they aren't in AC or aren't in SURGE kick em p:Kick() end end) |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2017 05:51 PM |
| altair... your syntax is triggering me... |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2017 05:53 PM |
local GroupId = 0000
game.Players.PlayerAdded:connect(function(plr) if not plr:IsInGroup(GroupId) then plr:Kick("Entrance Denied") end end) |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2017 05:57 PM |
For multiple groups:
local Groups = {0000,0000,0000}
local function InGroup(Player) for i = 1,#Groups do if Player:IsInGroup(Groups[i]) then return true end end return false end
game.Players.PlayerAdded:connect(function(Player) if not InGroup(Player) then Player:Kick("Denied Access") end end) |
|
|
| Report Abuse |
|
|
55Altair
|
  |
| Joined: 18 Oct 2008 |
| Total Posts: 6272 |
|
| |
|