Skip to content

Commit

Permalink
Update 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FAXES authored Jun 16, 2019
1 parent 5ae1d45 commit 320538d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
----------------------------------------

--- Config ---
roleNeeded = "Member" -- The role nickname needed to pass the whitelist
notWhitelisted = "You are not whitelisted for this server." -- Message displayed when they are not whitelist with the role
noDiscord = "You must have Discord open to join this server." -- Message displayed when discord is not found

roles = { -- Role nickname(s) needed to pass the whitelist
"Role1",
"Role2",
"Role3",
}


--- Code ---

Expand All @@ -22,10 +27,12 @@ AddEventHandler("playerConnecting", function(name, setCallback, deferrals)
end

if identifierDiscord then
if exports.discord_perms:IsRolePresent(src, roleNeeded) then
deferrals.done()
else
deferrals.done(notWhitelisted)
for i = 1, #roles do
if exports.discord_perms:IsRolePresent(src, roles[i]) then
deferrals.done()
else
deferrals.done(notWhitelisted)
end
end
else
deferrals.done(noDiscord)
Expand Down

0 comments on commit 320538d

Please sign in to comment.