local productId = 2148122000
local player = game.Players.LocalPlayer
function success()
for i = 1,10 do
wait()
print("+1")
script.Parent.Parent.Parent:FindFirstChild("Ksbutton"):FindFirstChild("Click"):FireServer()
end
script.Enabled = false
wait()
script.Enabled = true
end
script.Parent.MouseButton1Click:connect(function() --DONT CHANGE THIS
game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
game:GetService("MarketplaceService").PromptProductPurchaseFinished:Connect(function()
print("no way p2w")
success()
end)
end)
#i want the function to only work when you actually buy the prompt
6 messages · Page 1 of 1 (latest)
Hi!
I'm pretty sure the MarketPlaceService only runs on serverside scripts (not localscripts). You might also want to change it all to a serverside script for security reasons, as an exploiter could easily fire your remote event without buying the product, if your authentication is in a localscript.
A