GetRankinGroup is not a valid member of Player

function getStaff(player)
	local rank = player:GetRankinGroup(groupId)
	if rank >= 4 then
		return true
	else
		return false
	end 
end

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message, recipient)
		message = string.lower(message)
		local preArgs = message:split(" ")		
		local preCommand = preArgs[1]
		local cmd = preCommand:split("/")
		cmd = cmd[2]
		
		if commands[cmd] then
			local args = {}
			
			for i = 2, #preArgs do
				table.insert(args, preArgs[i])
			end
			
			if cmd == "apply" then
				commands[cmd](player, args)
			elseif cmd == "give" then
				if getStaff(player) then
					commands[cmd](player, args)
				end
			elseif getAdmin(player) then
				commands[cmd](player, args)
			end
		end
	end)	
end)

Currently, when I run the /apply command, I receive the error shown in the image above. I have exhausted the documentation, and what I am doing with :GetRankInGroup seems to be correct. Does anyone know how to stop this error from occuring?

It’s not “GetRankinGroup”, but rather “GetRankInGroup” - the “I” in “in” should be capital. Pretty much anything is case-sensitive

lol im so tired i didnt see my casing ty for the help

Most API methods, properties, callbacks and events follow a pascal casing scheme, i.e; AFunctionName, APropertyName. The only cases that don’t fit this rule are some of the Roblox datatype constructor functions, i.e; CFrame.lookAt().