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
 

How would I...?

Previous Thread :: Next Thread 
RainbowPianoUnicorn is not online. RainbowPianoUnicorn
Joined: 30 Mar 2014
Total Posts: 168
08 Jun 2014 08:17 AM
How would I do this:
I want a developer product to giver a player 'points' on the Leaderboard called 'Dollars'. How would I go across this?
It says:
player.Character.Humanoid.Health = 100
(It is a healing developer product made by a friend)
What should I do?
Report Abuse
RainbowPianoUnicorn is not online. RainbowPianoUnicorn
Joined: 30 Mar 2014
Total Posts: 168
08 Jun 2014 08:18 AM
The full script:
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 20063612
MarketplaceService.ProcessReceipt = function(receiptInfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == productId then
player.Character.Humanoid.Health = 100
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has purchased a healing potion."
end
end
end
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
08 Jun 2014 08:18 AM
player.leaderstats.Dollars.Value = player.leadersats.Dollars.Value + 100
Report Abuse
RainbowPianoUnicorn is not online. RainbowPianoUnicorn
Joined: 30 Mar 2014
Total Posts: 168
08 Jun 2014 08:19 AM
Simple as that? Thanks, I forgot what to put there (leaderstats).
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