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

why does this return false even though its true?

Asked by 4 years ago
game.Players.PlayerAdded:Connect(function(player)
    if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, 2070427) == false then
        print("false")
    else
        print("true")
    end
end)

it prints false but its the swat gamepass from jailbreak that i tested with and i do own it

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Try this:

game:GetService("Players").PlayerAdded:Connect(function(player)
    if game:GetService("MarketplaceService"):PlayerHasPass(player, 2070427) then
    print(player.Name..' Owns The Gamepass')
    else
    print(player.Name..' Doesn\'t Own The Gamepass')
    end
end)
0
Excuse my indenting. JudgeDuckie 25 — 4y
0
no seems like using playerownsasset dont really do anything Gameplayer365247v2 1055 — 4y
0
Oh I made a tiny mistake, switch PlayerOwnsAsset with PlayerHasPass. JudgeDuckie 25 — 4y
0
nvm i worked it out using another system with userownsgamepass Gameplayer365247v2 1055 — 4y
0
also, didnt u have points before? Gameplayer365247v2 1055 — 4y
Ad

Answer this question