Player:IsInGroup DataModel error

This is a strange bug because it’s not happening on every occasion, but when I try to call the method Player:IsInGroup(GroupId), it will return that warning sometimes. I am currently calling it from a LocalScript, as that returns the most recent information. Any help would be appreciated, thanks.

Player:IsInGroup()

What does your localscript code look like?

local group_member = false   
local success,warning = pcall(function()
    group_member = Player:IsInGroup(5812229)
end)
if warning then
    warn(warning)
end

I tried your code quite a few times to test it, and It returned true for me every time. I’m not sure why it doesn’t happen every occasion, but are you trying to not use PlayerAdded in this sense?

No, I’m calling it inside of a function that runs, typically 2-3 minutes into the game. It usually returns correctly, but occasionally returns with that error message.

You can do

local group_member = false   
local success,ingroup= pcall(function()
    return Player:IsInGroup(5812229)
end)
if not ingroup then
  print('ok2')
end
if ingroup then
print('member!')
end
1 Like