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: k why isnt this simple script working

Previous Thread :: Next Thread 
sharpblaze2 is not online. sharpblaze2
Joined: 22 Aug 2010
Total Posts: 19195
18 Mar 2016 09:25 PM
local passId = 1111111111111111111
local marketplaceService = game:GetService("MarketplaceService")

marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased)
if isPurchased then
if assetId == passId then
player.Humanoid.Health = 150
end
end
end)
Report Abuse
sharpblaze2 is not online. sharpblaze2
Joined: 22 Aug 2010
Total Posts: 19195
18 Mar 2016 09:28 PM
b1
Report Abuse
Brick_Wizard is not online. Brick_Wizard
Joined: 15 Mar 2016
Total Posts: 2072
18 Mar 2016 09:30 PM
I think roblox has broken a whole lot of stuff, same for me http://forum.roblox.com/Forum/ShowPost.aspx?PostID=185615428
Report Abuse
sharpblaze2 is not online. sharpblaze2
Joined: 22 Aug 2010
Total Posts: 19195
18 Mar 2016 09:30 PM
b2
Report Abuse
sharpblaze2 is not online. sharpblaze2
Joined: 22 Aug 2010
Total Posts: 19195
18 Mar 2016 09:32 PM
couldnt it simply be that i made the script wrong?
Report Abuse
sharpblaze2 is not online. sharpblaze2
Joined: 22 Aug 2010
Total Posts: 19195
18 Mar 2016 09:46 PM
20 views, no comments...
Report Abuse
admiralsharp is not online. admiralsharp
Joined: 20 Feb 2009
Total Posts: 383
18 Mar 2016 10:51 PM
You forgot MaxHealth ^^

Siggy for Ms. Piggy
Report Abuse
unroot is not online. unroot
Joined: 18 Sep 2009
Total Posts: 1114
18 Mar 2016 10:56 PM
player.Humanoid.MaxHealth = 150
player.Humanoid.Health = 150


#code print("yolo" .. string.rep("o", math.huge))
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
18 Mar 2016 11:38 PM
@op your lucky, i don't open source my own personal code; but here: (edit to your liking)


local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local bloxyColaId = 20701947
local bloxyColaId2 = 20616939
local bloxyColaId3 = 20799676
local PointsToGive = 100 --20701947
local PointsToGive2 = 500 --20616939
local PointsToGive3 = 5000 --20799676

script.Parent.Shop1Button.MouseButton1Down:connect(function()
local player = script.Parent.Parent.Parent.Parent
game:GetService("MarketplaceService"):PromptProductPurchase(player, bloxyColaId)
end)

script.Parent.Shop2Button.MouseButton1Down:connect(function()
local player = script.Parent.Parent.Parent.Parent
game:GetService("MarketplaceService"):PromptProductPurchase(player, bloxyColaId2)
end)

script.Parent.Shop3Button.MouseButton1Down:connect(function()
local player = script.Parent.Parent.Parent.Parent
game:GetService("MarketplaceService"):PromptProductPurchase(player, bloxyColaId3)
end)

game:GetService("MarketplaceService").ProcessReceipt = function(receiptInfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId==bloxyColaId then
player.leaderstats.Points.Value = player.leaderstats.Points.Value + PointsToGive--1
end
if receiptInfo.ProductId==bloxyColaId2 then
player.leaderstats.Points.Value = player.leaderstats.Points.Value + PointsToGive2--2
end
if receiptInfo.ProductId==bloxyColaId3 then
player.leaderstats.Points.Value = player.leaderstats.Points.Value + PointsToGive3--3
end
end
end

local playerProductKey = "p_" .. receiptInfo.PlayerId .. "_p_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
18 Mar 2016 11:39 PM
Thats for a gui this is for click detector:



-- Put the ID of the DevProduct in place of 29845207
local bloxyColaId = 29845207

-- When a player clicks on the sphere, they will be asked if they wish to purchase the DevProduct
script.Parent.ClickDetector.MouseClick:connect(function(player)
Game:GetService("MarketplaceService"):PromptProductPurchase(player, bloxyColaId)
end)

local MarketplaceService = game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local ProductHat1 = game.ReplicatedStorage.Sten
--local ProductHat3 = game.ReplicatedStorage.HATNAME

MarketplaceService.ProcessReceipt = function(receiptInfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId==29845207 then
ProductHat1:clone().Parent = player.Backpack
end
end
end

local playerProductKey = "p_" .. receiptInfo.PlayerId .. "_p_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
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