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

How do I make a gamepass for a gear?

yea I'm making an obby right now and I really wanna know how to make a gamepass for both a speed and gravity coil. If u have an answer or a script sample which I can use to practice my coding then that would be great! Thanks!

4 comments

0

If he meant one time purchases he would've said developer product?

0

One time purchase in the context you're only buying it once, the article is about Game passes

0

yea it is one time purchase

2 answers

A service you can use to check if someone owns a gamepass is called "MarketplaceService"

And a function that MarketplaceService has is called "UserOwnsGamePassAsync"

In the first argument, you add the player's userID to check, in the second argument, you add the gamepass ID to check

Example:

local player = game.Players:GetChildren()[math.random(1, #game.Players:GetChildren())] -- Checks a random player, change this localvalue so it is correct.

local MarketplaceService = game:GetService("MarketplaceService")

if MarketplaceService:UserOwnsGamePassAsync(player.UserId, 2296901) then -- change the numbers to a gamepass id
	print(player.Name .. " owns the gamepass!")
else
	print(player.Name .. " does not own the gamepass!")
end

1 comment

0

thx dude

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