#Group Rank Returning 0

1 messages · Page 1 of 1 (latest)

eager carbon
#

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.)

prime sage
mint reef
#

@eager carbon I'm honestly not sure what's wrong? I just ran that exact script in my studio and it worked

#

maybe it's because of whatever you're doing with source and GetPlayerByUserId but i doubt it

eager carbon
prime sage
#

i thought you were doing a proximity prompt

cosmic bloom
#

Maybe bug?