gamepassid=163752053 player = game.Players.LocalPlayer if game:GetService("GamePassService"):PlayerHasPass(player,gamepassid) then script.Parent.Visible = true else script.Parent.Visible = false end
when i join the game the gui just disappears and doesn't reconized the player if he/she has the gamepass
The game pass service does not work correctly from local scripts. Instead, use the MarketplaceService. The PlayerOwnsAsset method also works for checking game passes.
gamepassid=163752053 player = game.Players.LocalPlayer if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,gamepassid) then script.Parent.Visible = true else script.Parent.Visible = false end