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?