From a380bf619ccac5deafae15a0eb54aa4761fc2c84 Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Wed, 10 Aug 2022 00:24:57 +0200 Subject: [PATCH] Fix(characterSelection/server/events): Stuck on connecting to discord. --- ND_Core/server/events.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ND_Core/server/events.lua b/ND_Core/server/events.lua index aa7518f..8f76d4e 100644 --- a/ND_Core/server/events.lua +++ b/ND_Core/server/events.lua @@ -14,10 +14,10 @@ AddEventHandler("playerConnecting", function(name, setKickReason, deferrals) deferrals.done("Your discord isn't connected to FiveM, make sure discord is open and restart FiveM.") else if config.enableDiscordWhitelist then - local discordUserId = string.gsub(discordIdentifier, "discord:", "") - local roles = NDCore.Functions.GetUserDiscordInfo(discordUserId).roles + local discordUserId = discordIdentifier:gsub("discord:", "") + local discordInfo = NDCore.Functions.GetUserDiscordInfo(discordUserId) for _, whitelistRole in pairs(config.whitelistRoles) do - if roles[whitelistRole] or whitelistRole == 0 or whitelistRole == "0" then + if whitelistRole == 0 or whitelistRole == "0" (discordInfo and discordInfo.roles[whitelistRole]) then deferrals.done() break end @@ -88,4 +88,4 @@ end) RegisterNetEvent("ND:updateClothes", function(clothing) local player = source NDCore.Functions.UpdateClothes(NDCore.Players[player].id, clothing) -end) +end) \ No newline at end of file