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

Can someone help with my cash giver button? Will explain more below!

Asked by 8 years ago
Edited 8 years ago

My script gives me cash but for some reason it wont let me spend it in game to buy droppers!

local ting = 0

function onTouched(hit)
    if ting == 0 then 
    ting = 1
    check = hit.Parent:FindFirstChild("Humanoid")
    if check ~= nil then 

        local user = game.Players:GetPlayerFromCharacter(hit.Parent)
        local stats = user:findFirstChild("leaderstats")

        if stats ~= nil then 
            local cash = stats:findFirstChild("Cash")
            cash.Value  = cash.Value  +500 
        wait(5)
        end 
    end 
    ting = 0
    end 

end 

script.Parent.Touched:connect(onTouched)

This is the script in my button, I can buy it and it gives me the cash, but for some reason I can't spend the cash :/

local productId = 36415601  
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
    Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)

0
so post the script that isn't working patrline5599 150 — 8y
1
This looks fine, it's probably the buy button script, put that in the post please. You appear to have put the wrong script... General_Scripter 425 — 8y
0
The script works fine, thats what i need help with, I get the cash but it won't let me spend it :/ stethepea16 5 — 8y

Answer this question