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
 

Can someone show me what is wrong with this script?

Previous Thread :: Next Thread 
RyGanFireblast1224 is not online. RyGanFireblast1224
Joined: 27 Apr 2013
Total Posts: 478
10 Jan 2016 02:10 PM
Should I put this:

marketplace.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == 30218530 and receiptInfo.PlayerId == localPlayer.UserId then
game.ServerStorage.MoneyStorage[localPlayer.Name].Value = game.ServerStorage.MoneyStorage[localPlayer.Name].Value + 100000
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end

in a normal script in ServerStorage?


#code local = OP if OP = noob then print "get out"
Report Abuse
BanTech is not online. BanTech
Joined: 31 Dec 2015
Total Posts: 886
10 Jan 2016 02:10 PM
You can only access serverstorage and the processreceipt stuff from a server script, not a local script, so that needs to be in a regular script in the workspace. Make sure you remove the last chunk from the localscript.
Report Abuse
RyGanFireblast1224 is not online. RyGanFireblast1224
Joined: 27 Apr 2013
Total Posts: 478
10 Jan 2016 02:14 PM
Ok, I did all you asked but it wasn't working so I added local ProductId = 30218530 is that a fix?


#code local = OP if OP = noob then print "get out"
Report Abuse
BanTech is not online. BanTech
Joined: 31 Dec 2015
Total Posts: 886
10 Jan 2016 02:19 PM
If it makes it work then yes ;) yeah it will need that line
Report Abuse
RyGanFireblast1224 is not online. RyGanFireblast1224
Joined: 27 Apr 2013
Total Posts: 478
10 Jan 2016 02:20 PM
Still not working :/

Here is what I have

LocalScript in ScreenGUI:

local marketplace = game:GetService("MarketplaceService")
local productId = 30218530
local localPlayer = game.Players.LocalPlayer
local buyButton = script.Parent:WaitForChild('Button3')

buyButton.MouseButton1Click:connect(function()
marketplace:PromptProductPurchase(localPlayer, productId)
end)


Script (normal) in Workspace:


marketplace = game:GetService("MarketplaceService")

marketplace.ProcessReceipt = function(receiptInfo)
local playerName = game.Players:GetPlayerFromUserId(receiptInfo.PlayerId).Name
if receiptInfo.ProductId == 30218530 then
game.ServerStorage.MoneyStorage[playerName].Value = game.ServerStorage.MoneyStorage[playerName].Value + 100000
end
end


#code local = OP if OP = noob then print "get out"
Report Abuse
BanTech is not online. BanTech
Joined: 31 Dec 2015
Total Posts: 886
10 Jan 2016 02:28 PM
Any errors?
Is this is studio or in-game?
Are you sure that every player gets a value in MoneyStorage?
Is that value called the same name as the player?
Report Abuse
RyGanFireblast1224 is not online. RyGanFireblast1224
Joined: 27 Apr 2013
Total Posts: 478
10 Jan 2016 02:32 PM
No errors that I see
In-game
Yes, I have used the developer console to manually give people money
Yes



#code local = OP if OP = noob then print "get out"
Report Abuse
BanTech is not online. BanTech
Joined: 31 Dec 2015
Total Posts: 886
10 Jan 2016 02:34 PM
Send me a link and I'll come help you out personally. Does the purchase prompt come up?
Report Abuse
RyGanFireblast1224 is not online. RyGanFireblast1224
Joined: 27 Apr 2013
Total Posts: 478
10 Jan 2016 02:37 PM
A DL link for the place?


#code local = OP if OP = noob then print "get out"
Report Abuse
BanTech is not online. BanTech
Joined: 31 Dec 2015
Total Posts: 886
10 Jan 2016 02:38 PM
A link to come visit the place while uploaded, just a link to the game. I don't need to download it
Report Abuse
RyGanFireblast1224 is not online. RyGanFireblast1224
Joined: 27 Apr 2013
Total Posts: 478
10 Jan 2016 02:40 PM
http://www.roblox.com/games/326173207/Pirate-Tycoon-v0-4b


#code local = OP if OP = noob then print "get out"
Report Abuse
Previous Thread :: Next Thread 
Page 2 of 2Go to page: 1, [2] Prev
 
 
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