local tool = script.Parent
local handle = tool.Handle
local hitbox = tool.Hitbox
local repstorage = game:GetService("ReplicatedStorage")
local coal = repstorage.Coal
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local debounce = false
local hitboxTouchedConnection = nil
tool.Activated:Connect(function(on)
if debounce then return end
debounce = true
hitbox.CanTouch = true
if (hitboxTouchedConnection~=nil) then
hitboxTouchedConnection:Disconnect()
end
hitboxTouchedConnection = hitbox.Touched:Connect(function(hit)
if hit.Name == "CoalOre" then
print("MINE")
local clone = coal:Clone(1)
clone.Parent = player:FindFirstChild("Backpack")
clone.Handle.CanTouch = true
hitbox.CanTouch = false
task.wait(1)
debounce = false
else
return false;
end
end)
end)
^^ clone script
do i need to like repeatedly check for it or something?