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

How do I make a GAME PASS give cash in a Game?

Asked by 6 years ago

I have been trying to do this for a while. Just need some help. NOT A DEV PRODUCT, a game pass.

0
http://wiki.roblox.com/index.php?title=Game_pass look at the script on the bottom. UgOsMiLy 1074 — 6y
0
How would i add it so it gives money? SGYTMinersHaven -16 — 6y
0
Use the PromptPurchaseFinished event and check if the 3rd parameter is true. If it is, then give them cash. UgOsMiLy 1074 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I stole this from the wiki, credits to the wiki and to UgOsMily for sending link..

Here is the script.. Follow the instructions... I am pretty sure this should be a LocalScript. in StarterGui...

You may change the variable CASHHHH to whatever leaderstat you have and change the passId to whatever gamepass Id you have Change "Amount" to how much money you wanna give to the player

---------------------EDIT VVVVV------------------------
local CASHHHH = game.Players.LocalPlayer.leaderstats.Cash -- Don't add .Value at the end of this
local Amount = 100
---------------------EDIT ^^^^^ ----------------------

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 assetId == passId then
            CASHHHH.Value = CASHHHH.Value + Amount
        end
    end
end)
Ad

Answer this question