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

Instant Gamepass Detection?

Asked by 8 years ago

I heard a short while ago that there was a new way to detect whether a player had bought a gamepass without them having to rejoin the game. However, I'm not sure of the process (or services) to get this.

RepStore    = game:GetService("ReplicatedStorage")
Handler     = RepStore:WaitForChild("Handler")
if Handler:InvokeServer(266469588) then -- GAMEPASS ID HERE
    script.Parent.Parent.Spawn.Visible = true
    script.Parent.Visible = false
    script.Parent.Parent.Parent.OwnedBikes.Bike15.Bike15.Visible = true
end

This is my current script that I have in a Local Script on my game's main menu GUI, how would I make it instantly hide if the player owns the gamepass?

Cheers,

Michael

2
It's suggested that you should use MarketPlaceService instead of GPS for checking if a Player has a Gamepass to avoid said issue User#6546 35 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I think gamepass can't be instantaneous. I think what you heard was Developer product wich is instant and not permanent. Usually used for ingame currency. (http://wiki.roblox.com/index.php/Developer_product)

I found this gamepass script wich promisses to do something after purchase.I don't know if it works.

local passId = 0000 --change this to your GamePass Id
local marketplaceService = game:GetService("MarketplaceService")

marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased)
    if isPurchased then --if the player did pay
        if assetId == passId then --if what they bought is the pass
            print(player.Name .. " bought the pass (" .. passId .. ")")
        end
    end
end)

--script from http://wiki.roblox.com/index.php?title=Game_pass#Giving_the_Game_Pass_an_effect

Ad

Answer this question