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 » Scripting Helpers
Home Search
 

Re: DEV PRODUCT HELP *URGENT*

Previous Thread :: Next Thread 
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 10:03 PM
This is my current script, how do i make it add cash to the player/buyer of the dev product? The cash is located at
"game.Players.LocalPlayer.leaderstats.Cash.Value"

local productId = 21651010
local player = game.Players.LocalPlayer
local gift = game.Players.LocalPlayer.leaderstats.Cash
bought = false
mk = game:GetService("MarketplaceService")

function onClick()
mk:PromptProductPurchase(player, productId)
bought = true
mk.PromptProductPurchaseFinished:connect(function(p,id,own)
if(own)then gift.Value + 1000
print(p.Name.." has successfully bought "..mk:GetProductPurchase(id).Name.."!")
else
print(p.Name.." has rejected payment.")
bought = false
end
end)
end

script.Parent.MouseButton1Click:connect(onClick)


"the universe came from a magic explosion" - athiests
Report Abuse
EPICJAKEISCOOL is not online. EPICJAKEISCOOL
Joined: 07 Feb 2013
Total Posts: 1756
15 Nov 2014 10:05 PM
gift.Value = gift.Value + 1000
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 10:08 PM
thx jake u r really cool k

"the universe came from a magic explosion" - athiests
Report Abuse
EPICJAKEISCOOL is not online. EPICJAKEISCOOL
Joined: 07 Feb 2013
Total Posts: 1756
15 Nov 2014 10:09 PM
no prob
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 10:16 PM
w8 it didn't work

"the universe came from a magic explosion" - athiests
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 10:17 PM
i think its somewhere here:
local gift = game.Players.LocalPlayer.leaderstats.Cash.Value

"the universe came from a magic explosion" - athiests
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 10:24 PM
erm..
local gift = game.Players.LocalPlayer:FindFirstChild(leaderstats, Cash)

"the universe came from a magic explosion" - athiests
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 10:27 PM
because it says "leaderstats" is not a valid child of Player or whatever

"the universe came from a magic explosion" - athiests
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 10:31 PM
Help, guys?

"the universe came from a magic explosion" - athiests
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 10:35 PM
Come on guys, it shouldn't be that hard...

"the universe came from a magic explosion" - athiests
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 11:04 PM
help?

"the universe came from a magic explosion" - athiests
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 11:05 PM
Come on...

"the universe came from a magic explosion" - athiests
Report Abuse
ZeveI is not online. ZeveI
Joined: 29 Sep 2012
Total Posts: 8003
15 Nov 2014 11:08 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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