Hello, i’m trying to make a command that bans the player from the server. But I want to check if the player running that command is higher than the target’s rank in the group.
commands.serverban = function(player,target)
if target and not player:GetRankInGroup(9017622) < target:GetRankInGroup(9017622) then --Error
target:Kick(player.Name.." has banned you from the server!")
game.ReplicatedStorage.BindableEvents.AddBannedPlayer:Fire(target)
logEvent:FireAllClients(player.Name.." used 'serverban' on player "..target.Name,true)
end
end
I get the error Attempt to compare boolean < number.
Are you sure though? Can you try this to make sure you’re not sending a BoolValue or a Bool?
commands.serverban = function(player,target)
print("Player: ", player)
print("Target: ", target)
if target and not player:GetRankInGroup(9017622) < target:GetRankInGroup(9017622) then --Error
target:Kick(player.Name.." has banned you from the server!")
game.ReplicatedStorage.BindableEvents.AddBannedPlayer:Fire(target)
logEvent:FireAllClients(player.Name.." used 'serverban' on player "..target.Name,true)
end
end