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

The Sell Area In My Game Still Will Not Work Can Someone Help?

Asked by
zpfran -25
5 years ago

The script is supposed to detect when the player touches the brick or part that is inside the sell and if the players has more than 1 duck or item than it will sell depending on the rebirth amount, then the item amount should go back to 0 and you get your cash.

local Part = script.Parent
Part.Touched:Connect(function(HIT)
    local H = HIT.Parent:FindFirstChild("Humanoid")
    if H then
        local player = game.Players:WaitForChild(HIT.Parent.Name)
        if player then
            local leaderstats = player:WaitForChild("leaderstats")
            local currency = leaderstats.Cash
            local selling = leaderstats.Ducks
            if selling.Value > 0 then
                currency.Value = currency.Value + selling.Value * 1 * (leaderstats.Rebirth.Value +1)
            end
        end
    end
end)
1
Imagine getting 322 views to not get a single answer or a helpful comment Simpletton 82 — 5y
0
What isn't working? SaltyIceberg 81 — 5y
0
It won't Sell The Ducks for My Currency zpfran -25 — 5y

Answer this question