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

How would i make this check the tool damage instead?

Asked by 4 years 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 1055 — 4y

Answer this question