New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How would i make this check the tool damage instead?

Asked by 3 months ago

how would i make this local script at line 10 check after the tool damage instead of going down one 25 no matter what tool i use?

local money = game.Players.LocalPlayer:WaitForChild("leaderstats").Money
local ore = game.Workspace.ores.ironore.ironore1
debounce = false
script.Parent.MouseButton1Click:Connect(function()
    if not debounce then
        debounce = true
        local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
        animation:Play()
        script.Parent.BackgroundColor3 = Color3.new(252, 0, 0)
    ore.Health.Value = ore.Health.Value - 25
    wait(0.75)
    animation:Stop()
    wait(0.25)
    script.Parent.BackgroundColor3 = Color3.new(0, 0, 255)
    debounce = false
    if ore.Health.Value <= 0 then
        ore:Clone().Parent = script.Parent.Parent.Parent.Parent.Backpack
    game.ReplicatedStorage:WaitForChild("ore_handler"):FireServer(money,ore)
    script.Parent.Parent:Destroy()
        if game.Players.LocalPlayer.PlayerGui:FindFirstChild("ScreenGui") then
        game.Players.LocalPlayer.PlayerGui.SceenGui:FindFirstChild("mine button"):Destroy()
        end
        animation:Stop()
    end
    end
end)
0
btw this is a local script Gameplayer365247v2 729 — 3mo

Answer this question