I've been working on this script for about a few hours now, and nothing I'm doing is solving the issue.
The script keeps saying that my rank is zero, even though I ran the getrankingroupasync on the commandbar and it said 251.
dealershipAdminCommand.Triggered:Connect(function(source)
local groupId = 1425783
local player = Players:GetPlayerByUserId(source.UserId)
print("dealer dbg received admin command from", player.Name)
local rankSuccess, rank = pcall(function()
return player:GetRankInGroupAsync(groupId)
end)
if not rankSuccess then
warn("dealer dbg failed to get rank:", rank)
return
end
print("dealer dbg rank:", rank)
if rank >= 254 or rank == 251 then
print("dealer dbg admin verified, opening panel")
DealershipRemotes.Admin:InvokeClient(player, {
invokeActionType = "openDealershipCIAdminPanel",
})
end
end)
I'm fresh out of ideas. (even tried with group owner, said 0.)