Rank check in group not working?

So in my game I have this crate and it supposed to give only a certain group rank the gun, but its giving them all, how do I fix it?

local toolName = script.Parent.Parent.ToolValue.Value
local count = script.Parent.Parent.Count.Value
local amount = script.Parent.Parent.Amount.Value
counter = amount

function onMouseClick(player)
	if player:IsInGroup(5919861) then
		if player:GetRankInGroup(5919861) == 255 or 244 then
		if player.Backpack:FindFirstChild(toolName) == nil then
	if script.Parent.Parent.Count.Value > 0 then
		local tool = game.ServerStorage["Pooger 19"]:Clone()
		tool.Parent = player.Backpack
		script.Parent.Parent.Count.Value = script.Parent.Parent.Count.Value - 1
		script.Parent.Parent.Surface.SurfaceGui.TextLabel.Text = tostring(script.Parent.Parent.Count.Value).."/"..tostring(amount)
	end
		end
	end
	end
	end
script.Parent.MouseClick:connect(onMouseClick)
1 Like

This statement will always be true since 244 is a truthy value (not false or nil).

if player:GetRankInGroup(5919861) == 255 or player:GetRankInGroup(5919861) == 244 then