-- Requires

local APIEquipment = require(ReplicatedStorage.Common.APIEquipment)

PlayersService.PlayerAdded:Connect(function(player)
	
	-- When the character is added we'll listen for them to die.
	player.CharacterAdded:Connect(function(character)
		
		local humanoid = character:WaitForChild("Humanoid")
		if not humanoid then return end
		
		-- As soon as the player dies the weapons are removed
		humanoid.Died:Connect(function()
			APIEquipment.RemoveWeapons(player)
		end)
		
	end)
	
end)
