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

Player owns gamepass not working?

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
	

3 comments

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

0

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

2 answers

✓ Accepted answer

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)

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