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

Tycoon Sell Part (When the dropper drops the ore)?

Asked by 4 years ago

I want to make it so that once a part(the ore) hits the sell part it does part:remove() and then add the cash value from the ore into the players leaderstats.

This is my script for the Sell Part(Where the ore hits to sell):

function onTouched(part)
    if part.Name == "OneOre" then
        if part:FindFirstChild("CashProduce") then
            local Players = game:GetService("Players"):GetPlayers()

        wait(0.7)
part.CanCollide = false

part:remove()
        end
    end
end


script.Parent.Touched:connect(onTouched)

Answer this question