-----------------
--| Functions |--
-----------------


local function OnEquipped()
	local myModel = Tool.Parent
	local humanoid = myModel:FindFirstChild('Humanoid')
	if humanoid then -- Preload animations
		FireAndReloadTrack = humanoid:LoadAnimation(FireAndReloadAnimation)
	end
end

local function OnChanged(property)
	if property == 'Enabled' and Tool.Enabled == false then
		-- Play fire and reload animation
		if FireAndReloadTrack then
			FireAndReloadTrack:Play()
		end
	end
end

local function OnUnequipped()
	-- Stop animations
	if FireAndReloadTrack then FireAndReloadTrack:Stop() end
end
