Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why does this return false even though its true?

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

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)

5 comments

0

Excuse my indenting.

0

no seems like using playerownsasset dont really do anything

0

Oh I made a tiny mistake, switch PlayerOwnsAsset with PlayerHasPass.

0

nvm i worked it out using another system with userownsgamepass

0

also, didnt u have points before?

This discussion is preserved as it was. New answers, comments, and votes are closed.