New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

why does this return false even though its true?

Asked by 11 days 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 11 days ago
Edited 11 days 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 5 — 11d
0
no seems like using playerownsasset dont really do anything Gameplayer365247v2 727 — 11d
0
Oh I made a tiny mistake, switch PlayerOwnsAsset with PlayerHasPass. JudgeDuckie 5 — 11d
0
nvm i worked it out using another system with userownsgamepass Gameplayer365247v2 727 — 11d
0
also, didnt u have points before? Gameplayer365247v2 727 — 11d
Ad

Answer this question