amount = GetIntParam("amount", 4)
refillSound = LoadSound("tool_pickup.ogg")

function init()
	ammo = FindBody("ammo")
	if ammo > 0 then
		SetTag(ammo, "interact", "loc@PICK_UP")
	end
end

function tick(dt)
	if ammo > 0 and GetPlayerInteractBody() == ammo and InputPressed("interact") then
		RegisterTool("jackhammer", "JACKHAMMER", "MOD/prefab/tool/jackhammer.xml", 1)
        SetBool("game.tool.jackhammer.enabled", true)
		SetString("game.player.tool","jackhammer")
        SetString("game.tool.jackhammer.ammo.display","")
        PlaySound(refillSound,GetBodyTransform(ammo).pos)
		Delete(ammo)
	end
end

