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

How do I make a gamepass for a gear?

Asked by 4 years ago

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!

0
If he meant one time purchases he would've said developer product? EmK530 143 — 4y
0
One time purchase in the context you're only buying it once, the article is about Game passes bum5Br 97 — 4y
0
yea it is one time purchase robthepoop123 9 — 4y

2 answers

Log in to vote
0
Answered by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago

Please read the Roblox Developer hub before answering this question. And plus theres a special service called MarketPlaceService this service is basically a service that allows you to make gamepasses and sell them.

More info visit: https://developer.roblox.com/en-us/api-reference/class/MarketplaceService

Ad
Log in to vote
0
Answered by
EmK530 143
4 years ago

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
0
thx dude robthepoop123 9 — 4y

Answer this question