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)

1 comment
btw this is a local script