Database Login System Not working

I was working on a login system for a game I am makeing and it uses module for access (code below) but whenever I try to access it even though im in the group listed within the module it still wont work.

I have tried to change it to a diffrent one holding a userid but not even that works, code provied below.

(No errors)

AccessData Module

local Players = game:GetService("Players")
local player
local SG = require(game.ReplicatedStorage.FederalOS.SafeGuards)
local Clearance = SG.Clearances
local LocalAccess = {}

local DLPD = {
	    Group = 5567902,
		Rank = 7,
		State = "Washington",
		District = "Liberty",
		Clearance = Clearance.Official
}

local FederalList = {
	MilitaryCommand = {
		Group = 32879677,
        Rank = 7,
		State = "Washington",
		Clearance = Clearance.Official
	},
	USWH = {
		Group = 33034853,
		Rank = 7,
		State = "Washington",
		Clearance = Clearance.Official
	},
	DHS = {
		Group = 32914771,
		Rank = 7,
		State = "Nation-Wide",
		Clearance = Clearance.Official
	},
	FIB = {
		Group = 32879683,
		Rank = 7,
		State = "Nation-Wide",
		Clearance = Clearance.Official
	},
	IAA = {
		Group = 32914789,
		Rank = 7,
		State = "Nation-Wide",
		Clearance = Clearance.Official
	},	
}


return LocalAccess

GUI Code

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AccessData = require(ReplicatedStorage.FederalOS.AccessTable)
local Master = require(ReplicatedStorage.FederalOS.MasterAccess)
local Players = game:GetService("Players")

local Input = script.Parent.Username.TextBox

Input.FocusLost:Connect(function(enterPressed)
	if enterPressed then
		local groupName = Input.Text

			local player = Players.LocalPlayer
			if player then
				local Access = AccessData[groupName]

				local success, inGroup = pcall(function()
				return player:IsInGroup(Access.Group)
				end)

			if success and inGroup or Master.Access == player.Name then
					print("Placeeee")
				else
					print("Player is not in the group.")
				end
			end
		else
			print("Group not found in AccessData module.")
		end
	end)

Hey I solved it my mistake was not adding

AccessTable.DLPD = DLPD to define all the groups

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.