I am faced with such a problem that I cannot get player data from the table that is in the modular script when I request it and it gives me the error attempt to index nil with 'Gamepasses'
This is where the data table is created:
function module:AddPlayer(plr)
print("start")
ClientData[plr.UserId] = {
GroupRank = plr:GetRankInGroup(OfficialGroup),
MilitaryGroupRank = plr:GetRankInGroup(MilitaryGroup),
ActivityTracker = nil,
PlayedTime = {
Total = 0;
OnThisServer = 0;
},
Gamepasses = {
Donation = false,
WarheadAccess = false,
SelfDestructAccess = false,
SpeedCoil = false,
Tools = false,
VIP = false,
},
}
print(ClientData)
end
And when they were created and I checked them in the same module and in the same function, they were not nil
This is where the error appears when requesting data:
function module:GetPurchaseGamepassAsync(plr,DataName)
print(ClientData)
print(ClientData[plr.UserId])
if ClientData[plr.UserId].Gamepasses[DataName] ~=nil then -- Here error ocurred
return ClientData[plr.UserId].Gamepasses[DataName]
end
end
When I decided to look at the table and the player’s data in another function, but in the same scenario, it prints just {} for the table and the player data is nil
Any help would be appreciated