Client
print(1) -- Does print
if GamepassCheck:InvokeServer('+5 Inventory Space') then
Line2.Buy:Destroy()
end
print(2) -- Never prints
Server
local function ReturnGamepass(player, gamepass)
local GamepassID = PurchaseData.Gamepasses[gamepass]
if not GamepassID then return end
print('Checking gamepass', GamepassID) -- prints Checking gamepass 123456
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then
print('Yes') -- Does not print
return true
else
print('No') -- Does not print
return false
end
end
GamepassCheck.OnServerInvoke = ReturnGamepass
I know the gamepass id is just 123456, it’s just there as placeholder for me not owning the gamepass, and thus this should return false, however it isn’t.
The client fires the GamepassCheck:InvokeServer() when the player joins, so does a player need to load in properly or something before the server can check for them owning a gamepass?