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

Game Pass for in game money?

I understand how to make a gamepass but I have a simpsons game and I was wondering how to make it so that when someone buys the game pass they get donuts? Please help.

2 answers

Under the handle purchase script, do something like game.Players.LocalPlayer.leaderstats.money = game.Players.LocalPlayer.leaderstats.money + 5 -- or whatever amount you want to increase it by... see the example place for product purchases which is a link in the wiki tutorial at wiki.roblox.com. It'll have a comment in the script saying something like, --handle purchase, in the receipt script

4 comments

0

PassId = 219106579 game:GetService("Players").PlayerAdded:connect(function(Player) if game:GetService("GamePassService"):PlayerHasPass(Player, PassId) then Player:WaitForChild("leaderstats"):WaitForChild("donuts").Value = 100 end end)    Will this work?

0

it should, http://www.roblox.com/Developer-Product-Sample-place?id=147965737 here is the dev place, sorry for being lazy, inside the script that handles the purchase it should comment where you give the player whatever they bought in the pass

0

First of all, you should put any code you provide in code block. Secondly, if you're going to answer then answer fully.. saying 'do something like' and then not even providing full code isn't a good answer

0

ok I'm sorry

PassId = 219106579 game:GetService("Players").PlayerAdded:connect(function(Player) if game:GetService("GamePassService"):PlayerHasPass(Player, PassId) then Player:WaitForChild("leaderstats"):WaitForChild("donuts").Value = 100 end end)

Will this script work?

1 comment

0

You should comment, rather than putting an answer on your own question.

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