Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can anyone help me with this script?

Asked by 10 years ago
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

0
Do you own the gamepass? Also, are you testing this in an actual game, or are you playing solo? SlickPwner 534 — 10y
0
yes i do awesomegamers200 72 — 10y

1 answer

Log in to vote
1
Answered by
2eggnog 981 Moderation Voter
10 years ago

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
Ad

Answer this question