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

Player owns gamepass not working?

Asked by
Prestory 1395 Moderation Voter
5 years ago
Edited 5 years ago

So whats happening is basically that this gamepass owning thing is not working and i don't understand how to use the new system may anyone help me heres my code:

elseif Team == "Vampire" then
if game:GetService("MarketplaceService"):PlayerOwnsAsset(Player, 4770250) then

            -- Spawn
            if State == "Spawning" then
            Player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(4.08, 7.45, -185.67)
            end
            -- Spawn

    Player.TeamColor = BrickColor.new("Really red")
    DressUp()

    else
    game:GetService("MarketplaceService"):PromptPurchase(Player, 4770250)
end

0
Well could you show me an example with my code please since i said i knew i was meant to use this but after reading the wiki still confused on how to Prestory 1395 — 5y
0
if game:GetService("MarketplaceService"):UserOwnsGamepassAsync(Player.UserId, 4770250) then green271 635 — 5y

2 answers

Log in to vote
1
Answered by
green271 635 Moderation Voter
5 years ago

You should be using "UserOwnsGamepassAsync" and "PromptGamepassPurchase". Wiki pages: UserOwnsGamepassAsyncand PromptGamepassPurchase

Some exampls:

Line 2 - if game:GetService("MarketplaceService"):UserOwnsGamepassAsync(Player.UserId, 4770250) then

Line 14 - game:GetService("MarketplaceService"):PromptGamepassPurchase(Player.UserId, 4770250)0)

Ad
Log in to vote
0
Answered by
Dog2puppy 168
5 years ago
Edited 5 years ago

Your not using the correct methods for game passes. You have to use these:

PlayerOwnsGamePassAsync

PromptGamePassPurchase

Answer this question