Hello! I am trying to make a Admin Panel for a game I work for, but I have ran into a issue. I can not seem to give the panel to people, and I suspect actions would not work either.
I have the people who should have whitelist to the panel in a module here:
And I check if they have the whitelist like:
I do the exact same for checking if they can use the actual parts of the panel too, by doing table.find and seeing if they are listed in the whitelist module.
Heres how the hierarchy looks, just incase you were wondering. The script Coreshenns Panel is the one that gives the GUI, and it is placed in ServerScriptService.
You are unable to check if their username is in the table because of the way the whitelist table is setup!
In the provided whitelist table, you have values, therefore table.find() will search those variables value for the provided userId. Which its returning a table, not a userID. What I suggest doing is the following:
game.Players.PlayerAdded:Connect(function(player
player.CharacterAdded:Connect(function()
for _, v in pairs(Whitelist) do
if table.find(v, player.UserId) then
...
end
end
end
end
you wouldn’t even need a for loop for that. you can just do the following:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
if table.find(Whitelisted["AboveAdmins"], player.UserId) then
...
end
end
end