Hello im trying to make an admin gui for my game and it is working out great so far. The only issue i ran into is that getting the players role in the group does not work properly for me. Even if the players role on the group is not the role specified, the script still fires regardless and i do not know why this is.
game.Lighting.GUIRemotes.HakerRepelant.OnServerEvent:Connect(function(plr,passcode)
local playergroupid = plr:GetRoleInGroup(8161135)
if playergroupid == "Owner" or "Co-Owner" or "Admin" or "Moderator" or "Developer" then
if passcode == "FillerPassCodeForDevForum" then
if plr:FindFirstChild("AdminMenuAcess") == nil then
local AdminMenuAcess = Instance.new("Folder",plr)
AdminMenuAcess.Name = "AdminMenuAcess"
end
end
end
end)
Not sure why you’re holding your remotes in lighting but try this:
game.Lighting.GUIRemotes.HakerRepelant.OnServerEvent:Connect(function(plr,passcode)
local playergroupid = plr:GetRoleInGroup(8161135)
if table.find({"Owner", "Co-Owner", "Admin", "Moderator", "Developer"}, playergroupid) then
if passcode == "FillerPassCodeForDevForum" then
if not plr:FindFirstChild("AdminMenuAcess") then
local AdminMenuAcess = Instance.new("Folder")
AdminMenuAcess.Name = "AdminMenuAcess"
AdminMenuAcess.Parent = plr -- better performance
end
end
end
end)
aw, well its worth it if they get confused for a couple seconds, i left a few local scripts named “1 shot admin script” that litteraly just trolls hackers who reads it