I made a custome admin panel and you open it y pressing “m” on the keyboard but right now anyone can use it which is bad because they can ban kick and give any amount of cash I want it to only execute if the player is a certain rank in the group how would I do this?
Script
local Player = game:GetService(“Players”).LocalPlayer
local mouse = Player:GetMouse()
local PlayerGUI = Player:WaitForChild(“PlayerGui”)
GROUPID = 3336691
mouse.KeyDown:Connect(function(key)
if key == "m" then
if not Player:IsInGroup(GROUPID) then
return
end
gui.Visible = not gui.Visible
end
end)
However make sure additionally to check that the player is in the group on any server side requests too. As anything client-side can be manipulated.
My apologies I misread, here is the code you want:
GROUPID = 3336691
MIN_RANK = 254
mouse.KeyDown:Connect(function(key)
if Player:GetRankInGroup(GROUPID) < MIN_RANK then
return
end
if key == "m" then
gui.Visible = not gui.Visible
end
end)