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)
It works fine but the money isnt real money here is where it really stores money https://gyazo.com/66bf6d65944ea3c5bf03a2367ab18e2f
I want to make it so that way if any player buys it money gets added

3 comments
I would run this completely server sided. Only thing the client should do is promt purchase
How?????????????!!!!!!!!!! can you help
Simple. Dont use berezas tycoon kit it sucks. Use zednovs tycoon kit