Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you edit the location of where a dev product sends money? [closed]

Asked by 6 years ago

Ok so my script is supposed to change the leaderstats of your cash when you buy a dev product

local plr = script.Parent.Parent.Parent.Parent.Parent
local link = game:GetService("MarketplaceService")
deb = 0


script.Parent.MouseButton1Click:connect(function()
local marketId = 20383718 --ID OF YOUR DEVELOPER PRODUCT  
link:PromptProductPurchase(plr,marketId)
link.ProcessReceipt = function(receiptInfo)
if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then
if deb == 0 then
deb = 1
plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value + 1000 --Alter what stat you would like to increase or decrease after the player has purchased.
wait(1)
deb = 0
end
end
end
end)

As you can see it goes to plr.then leaderstats. But if you use berezaa's tycoon kit, it doesent actually Store the money there

Inside ServerStorage there is a smoke called MoneyStorage and inside of that there is a value with your name. then inside that is another value that is OwnsTycoon i have tried editing the script to make so it relocates where to send the money, but it doesent work!

plr.leaderstats.Cash.Value -- i changed to
ServerStorage.MoneyStorage.Localplayer -- i am not good with locating stuff not inside game.Workspace
0
If you don't know how to network it to access the player's stat in your game, you shouldn't be attempting this. Goulstem 8144 — 6y

Closed as Not Constructive by Goulstem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?