this could work but the problem is i don’t want them out the game i just want to stop the command from working when normal person use it on admin or owner and work when normal person use it on another normal person
just to be clear i want all HD admin commands stop working on admins and owner
I got what you need!!
First, create a Module Script, and place it in HD Admin/CustomFeatures/Server/Modules. NOTE: You have to name it FlingProtection
ModuleScript:
local FlingProtection = {}
local function HasAdminPermission(player)
local adminRole = game:GetService("Teams"):FindFirstChild("Admins")
if adminRole and player:IsInGroup(adminRole.GroupId) then
return true
end
return false
end
function FlingProtection.CheckFlingPermission(player, targetPlayer)
local isAdmin = HasAdminPermission(player)
local isTargetAdmin = HasAdminPermission(targetPlayer)
if isAdmin and isTargetAdmin then
return false
end
return true
end
return FlingProtection
Now, you have to create a Script and place it in ServerScriptService
Script:
local HDAdmin = require(game:GetService("ServerScriptService").HDAdmin)
local FlingProtection = require(script.Parent.Modules.FlingProtection)
HDAdmin:RegisterCommand({
Commands = {"fling"},
Description = "Fling the target player.",
Group = "Default",
Function = function(player, targetPlayer)
if FlingProtection.CheckFlingPermission(player, targetPlayer) then
print("Flinging target player:", targetPlayer.Name)
else
print("You cannot use this command on other admins.")
end
end
})
If you’ve been using free models I’d look into learning some more code, then you could configure the code more easily.
Infact, if you disect the HD admin code its alot easier to understand than you think. For example you can configure whos admin and whos not without using ;permrank user rank.