generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: i need some help please

Previous Thread :: Next Thread 
flubber003 is not online. flubber003
Joined: 17 Dec 2012
Total Posts: 88
20 Aug 2015 11:11 AM
so, I want to make the leaderstats increase the "Money" value 1000 when the game pass GUI is clicked, this is what I have so far:
local button = script.Parent
local marketplaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local gamePassId = 284502010


script.Parent.MouseButton1Down:connect(function()
marketplaceService:PromptPurchase(player, gamePassId)
end)

local MarketplaceService = game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 284502010

MarketplaceService.ProcessReceipt = function (receiptInfo)


for i,player in pairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.productId == productId then
player.leaderstats.Money.Value = player.leaderstats.Money.Value +1000

end
end
end

local playProductKey = "player_"..receiptInfo.PlayerId.."_purchase_" .. receiptInfo.productId
ds: incrementAsync(playProductKey)

return Enum.ProductPurchaseDecision.PurchaseGranted
end
Report Abuse
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
20 Aug 2015 11:13 AM
What exactly do you want? If you give someone a super long script and not know EXACTLY how you want help, you will never get an answer.

So far, I don't know what you are doing.
Report Abuse
flubber003 is not online. flubber003
Joined: 17 Dec 2012
Total Posts: 88
20 Aug 2015 11:18 AM
so the leaderstats script is the following:
print 'Hello world!'
game.Players.PlayerAdded:connect(function(player)
local leader, score = Instance.new('IntValue', player), Instance.new('IntValue')
leader.Name = 'leaderstats'
score.Name = 'Money'
score.Parent = leader
end)
this makes the leaderstats name Money

so the button in the GUI is a Money increasment gamepass.the button is in the GUI like the following:
game > starterGui > intro(Frame) > coins(the button)
I want to increase the stats by 1000 when the gamepass is purchased. its letting me purchase it, but it wont increase my stats by 1000
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
20 Aug 2015 11:20 AM
It has to be handled in a server script.
Report Abuse
cybersquat is not online. cybersquat
Joined: 02 Aug 2015
Total Posts: 5835
20 Aug 2015 11:20 AM
"Scripters
This is the place for discussion about scripting. Anything about scripting that is not a help request or topic belongs here."

Help requests don't belong here.
Report Abuse
flubber003 is not online. flubber003
Joined: 17 Dec 2012
Total Posts: 88
20 Aug 2015 11:21 AM
the big script in is a local script.
the leaderstats script is in a server script
Report Abuse
GoodkidMad is not online. GoodkidMad
Joined: 28 Feb 2014
Total Posts: 29
20 Aug 2015 11:24 AM
Make it a function then call out the function instead. Also is the leaderboard showing up for the value of money?
Report Abuse
flubber003 is not online. flubber003
Joined: 17 Dec 2012
Total Posts: 88
20 Aug 2015 11:28 AM
yes
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image